Chrysaor
asked on
<math.h> error in Microsoft Visual C++
I've created a header file which contains lines like this :
Value = 1*pow(10,13) + 3 * pow(10.0,4) , where Value is an unsigned long long.
The header file was working perfectly on Borland C++ Builder 6. I've tried to run it using Microsoft Visual Studio 2008,(Visual C++) and i get errors like this:
c:\my documents\visual studio 2008\projects\chrysaor\chr ysaor\File 2.h(168) : error C2668: 'pow' : ambiguous call to overloaded function
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\math.h(575) : could be 'long double pow(long double,int)'
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\math.h(527) : or 'float pow(float,int)'
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\math.h(489) : or 'double pow(double,int)'
while trying to match the argument list '(int, int)'
Why this happens and how do I fix it?
Thanks a lot.
Value = 1*pow(10,13) + 3 * pow(10.0,4) , where Value is an unsigned long long.
The header file was working perfectly on Borland C++ Builder 6. I've tried to run it using Microsoft Visual Studio 2008,(Visual C++) and i get errors like this:
c:\my documents\visual studio 2008\projects\chrysaor\chr
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\math.h(575)
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\math.h(527)
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\math.h(489)
while trying to match the argument list '(int, int)'
Why this happens and how do I fix it?
Thanks a lot.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Since your result is a long long, just to be safe, make the 1 and 3 1LL and 3LL respectively.
Since your result is a long long, just to be safe, make the 1 and 3 1LL and 3LL respectively.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.