I was playing around with Math.pow()
today in JavaScript, when I noticed that:
Math.pow(8, 1/3)
andMath.pow(27, 1/3)
return 2 and 3, respectivelyMath.pow(64, 1/3)
and all other higher perfect squares return long approximate floating point numbers, such as 3.99999999999999996.
I've heard of floating point precision and how some decimals can appear inexact, but this stood out to me because it only happens beginning at four cubed (64). Can anyone please explain why this happens?