I was trying to find the cube root of 10^12 and used the following code in c++. To my surprise, the value returned was different . Can anyone help me with this problem.
Output: 10000 9999
    int y;
    double x=pow(1000000000000, 1./3);
    double r=floor(x);
    y=(int)r;
    cout<<x<<" ";
    cout<<y;