Link to home
Start Free TrialLog in
Avatar of Chrysaor
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\chrysaor\File2.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.
ASKER CERTIFIED SOLUTION
Avatar of sistemu
sistemu
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cup
cup

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
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial