for int value 2,015,671 this code outputs 475,739,751
long long cube(int n)
{
return n*n*n;
}
While the correct value should be 8,189,529,329,933,957,120 but using the pow(n, 3) from <math.h> I got the correct result. If it is an overflow of long long type then why does it work for pow ? And it does not reach the MAX of long long data type 9,223,372,036,854,775,807. What is the explanation of this behaviour?