开发者

reverse square root: in a Math lib or how to calculate it

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜