|
|
вернуться в форумОбщий форумHow can I use PI & atan with judge in C++ ? Yes, but .. 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 .. > 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, > > > 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? |
|
|