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

Common Board

How can I use PI & atan with judge in C++ ?
Posted by Nazar Revutsky 22 Apr 2001 22:27
Yes, but ..
Posted by Marat Bakirov 23 Apr 2001 18:56
I tried the program:

-------------------------------------
#include <math.h>

void main( void )
{
   double x1, x2, y;

   x1 = 1; x2 = 1;

   y = atan( x1 );
   y = atan2( x1,x2 );
}
---------------------------------------

And it compiled! But , before a got many times the
message :
>temp\31135(7) : error C2668: 'atan' : ambiguous call to
overloaded function

so be carefull about types. Never use atan(1), use
x = 1;
atan(x)
Re: Yes, but ..
Posted by Ilya Semenov (NSU) 24 Apr 2001 10:15

> so be carefull about types. Never use atan(1), use
> x = 1;
> atan(x)

....or u may just use atan((double)1)
that's not reasonable, I think,
Posted by tjq(killer of zju) 29 Apr 2001 15:23
>
> > so be carefull about types. Never use atan(1), use
> > x = 1;
> > atan(x)
>
> ....or u may just use atan((double)1)

I hope you can do something about it, I often forget that,
as it goes well in my local compiler, it's not reasonable
to use double(1), in sqrt and sin and cos function.

Is the ambiguilty caused by conversion both to double and
complex?