Why does Math.cbrt(1728) produce a more accurate result than Math.pow(1728, 1/3)?
In JavaScript, Math.cbrt(1728) evaluate to the exact result of 12. However, the seemingly-equivalent expression Math.pow(1728, 1/3) evaluates to 11.999999999999998. Why do these results vary in precision?
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.