I expect to calculate 9^19 . my code is:
cout.setf(ios::fixed, ios::floatfield); cout.setf(ios::showpoint); cout<<pow(9,19)<<endl;
As a result, the last two digits are 0 : 1350851717672992000 . In Python 9**19 I got 1350851717672992089L . Seems to be a floating point problem. How to increase the accuracy of pow ? or how to convert higher precision than pow ?
I am compiling with gcc version 4.8.2.
source share