These docs are *very* out of date.
You will be redirected to the new docs in a few seconds.
If you are certain you want to see the old docs, click cancel.
Cancel | Continue to new docs
You will be redirected to the new docs in a few seconds.
If you are certain you want to see the old docs, click cancel.
Cancel | Continue to new docs
math.sqrt()
Description:
Returns the square root of a value.
Syntax:
math.sqrt (x)
Example:
print (math.sqrt (100)) ---> 10 print (math.sqrt (-1)) ---> nan
Parameters:
x
A number.
Returns:
A number, x2.
math.sqrt(x) is equivalent to using the exponentiation operator: x^0.5
Remarks:
Supported on operating systems and platforms for build numbers shown:
- Mac OS X:Corona SDK 1.0
- Windows:Corona SDK 2.0
- iOS:Corona SDK 1.0
- Android:Corona SDK 2.0