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 roo开发者_如何学JAVAt of 2
16 //output 4, because 16 is the square root of 4
That isn't a "reverse" square root. It's square root.
Use:
Math.sqrt (x);
Here's the documentation
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
squareRoot=Math.sqrt(value);
精彩评论