Skip to main content
Inspiring
May 3, 2006
Question

Third root

  • May 3, 2006
  • 13 replies
  • 1080 views
This is more mathematical but scripting problem, I guess, but I know that lot of you are expert of mathematics too.

I need to calculate a third root of a number (I'm not sure if that's the phrase in English).

Function for square root is built-in (Math.sqrt()), but there are no built-in functions for larger exponent roots.

How to calculate it?
This topic has been closed for replies.

13 replies

Inspiring
May 3, 2006
> trace(Math.sqrt(Math.sqrt(16)));

No...

that is the fourth root .. not the third (cube) root.

To calculate other roots you need to use logs and exponents.
--
Jeckyl



Kolja1987Author
Inspiring
May 3, 2006
Thanks, LuigiL, but you're wrong!
This would be a fourth root.
x^3 is not same as (x * x)^2
same sqrt(sqrt(x)) is not same as sqrt|3|(x)
Inspiring
May 3, 2006
trace(Math.sqrt(Math.sqrt(16)));