I am not sure about your code. But I think your code is like this
unsigned long x,y;
x=...
y=...
unsigned long res=pow(x,y);
It is not right. Since pow () always returns a double type.
double pow(double x, double y)
why did you get a double type of number.
To get the correct number, you can do the following:
unsigned long x,y;
x=...
y=...
unsigned long res=(unsigned long)pow(x,y);
source
share