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 1355. Bald Spot Revisited

Compilation Error!
Posted by Latina_Matrix 15 Nov 2006 13:17
I typed :
long temp = ( long) sqrt( b);
and i got a CE. Can anybody tell me why?
I included "math.h" already.
Re: Compilation Error!
Posted by Rybinsk SAAT (Nechaev, Kiselev, Mirzoyan) 15 Nov 2006 14:05
When I inserted this code:

double b = 2.0;
long temp = (long)sqrt(b);

in one of my AC solutions i got AC. But when i inserted this:

int b = 2;
long temp = (long)sqrt(b);

i got CE. Then i inserted this:

int b = 2;
long temp = (long)sqrt((double)b);

and got AC again. I think this call to sqrt() function is ambiguous, or something like that.

//Nechaev Ilya (Rybinsk SAAT)

Edited by author 15.11.2006 14:08
Re: Compilation Error!
Posted by Nechaev Ilya (Rybinsk SAAT) 15 Nov 2006 16:37
When you get CE you can receive on mail reply for your submit.

Here is one for my submit:

function "sqrt" matches the argument list:
            function "sqrt(double)"
            function "sqrt(float)"
            function "sqrt(long double)"
            argument types are: (int)

There are no function sqrt(int).

Edited by author 15.11.2006 16:38