mardi 23 janvier 2018

Calculation using power function gave wrong answers for large numbers

I have two values p=19 , q=14 . I want to calculate pow(p,q)using power function.

here is my code:

long long p=19,q=14;
cout<<pow(p,q);

the correct answer is:799006685782884121 but from code i am getting 799006685782884096 which is wrong .

I have also did these calculation using unsigned long long But didn't helped me.Please help me i am stuck at this

Aucun commentaire:

Enregistrer un commentaire