Cube Root

How does one go about getting the cube root of a number?

I've tried X^(1/3) and Math.cbrt(X) but neither works, unless I'm doing it wrong.



  • The exponent operator in javascript is **, so something like this may work:
    125 ** (1/3)

  • Thanx, Ed, I didn't know that; I figured Java used the same notation as other languages. I'll try that out.

Leave a Comment