I am looking to calculate 9^19
. my code is:
cout.setf(ios::fixed, ios::floatfield);
cout.setf(ios::showpoint);
cout<<pow(9,19)<<endl;
The result has the last 2 digits equal to 0
: 1350851717672992000
. In Python,9**19
got me 1350851717672992089L
. Seems a floating point issue. How could I raise the precision for pow
? or how to preform a better precision power than pow
?
I am compiling with gcc version 4.8.2.