ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1214. Strange Procedure

why???
Posted by hoan 15 Nov 2010 21:55
I got AC, but i dont understand why my code is correct,
in the other word in lines:
" y = sqrt(x+(y/labs(y))*(-labs(y)));"

sqrt(x+(y/labs(y)) > 0
(-labs(y))) < 0

but why when i compile this code y is positive !!!
sorry for my poor english.

Edited by author 15.11.2010 21:57
Re: why???
Posted by [USU] Rudnev Vladimir 20 Nov 2012 18:41
y = sqrt[x+(y/labs{y})*(-labs{y})]
so (y/labs{y})*(-labs{y}) < 0 but x + (y/labs{y})*(-labs{y}) > 0