views:

188

answers:

3

Does Actionscript have a function that would tell me what number the input is a square root of. For example:

4     //output 2, because 4 is the square root of 2
16    //output 4, because 16 is the square root of 4
+6  A: 

That isn't a "reverse" square root. It's square root.

Use:

Math.sqrt (x);

Here's the documentation

McAden
+2  A: 

you either want

Math.sqrt(x) (which returns the square root, i.e. Math.sqrt(4) == 2)

or

x*x (which returns the square, i.e. 4*4 = 16) :)

http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary469.html

oedo
+1  A: 
squareRoot=Math.sqrt(value);
Banjer