When I use pow(), I'm getting results that aren't close to right. I know pow() requires a floating point number and am using one but am still getting wrong results. The following code works:
double i = 4;
j = (2,i)
j will have 16.
But if I use a larger number (I'm trying to get 21 to the power of 2) it won't work correctly.
double i = 21;
j = pow(2,i);
j now holds 2.09715e+06
I'm not clear on why this is happening. Am I using the wrong data type? How do I get the right value out of this ( j = 441 )?