This doesn't make any sense to me. The pow() that is causing the problem is pow(10,45). When I take that term out and replace it with (1) or any other number the program compiles without problem. I need some way to write 10^45, I've tried typing 10000000000000000000000000000000000000000000000 and it says the constant is too long, and this pow function is not working. what do?
1>error C2668: 'pow' : ambiguous call to overloaded function
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(575): could be 'long double pow(long double,int)'
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(527): or 'float pow(float,int)'
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(489): or 'double pow(double,int)'
1> while trying to match the argument list '(int, int)'
Write 45.0 and 10.0. Then the compiler will treat them as doubles, and it will know to call the double function.
As it is, you are passing integers - 45 and 10 - so the compiler tries to convert the integers into a type it can pass to the function. But if can convert integers to floats, doubles or long doubles, and it doesn't know which to choose, hence the errors.
Sure. If you want to have floats rather than doubles, you can then write 45.0f, 10.0f etc. Google "C++ literals" to find out more about this kind of thing.
And if you write big constant integer numbers, to tell the compiler of what type they are, you can add the suffixes L (size of long i think), LL (size of long long), or U, UL and ULL for the unsigned equivalents. (The sizes i gave must depend on the architecture and compiler i guess)
Ex : 10000000000000000000000000000000000000000000000LL
Your number will still have to be storable in the integer size you specified of course