As we know that the range of unsigned long long int is 0 to 18,446,744,073,709,551,615
Means , unsigned long long int is capable for handling 19-20 digits easily.
So, I want to know why my this program is returning different value.
Program :
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int ulli;
int main()
{
double a,b;
cin>>a>>b;
ulli result = (ulli)pow(a,b);
cout<<"result = "<<result<<"\n";
}
After giving this input : a=15 , b=15
Expected output is : 437893890380859375 ( 18 digits number )
But , it is giving this : result = 437893890380859392 ( last 2 digits are different ).
Can anyone help me out why I am getting different result ?