×
A new build of Corona SDK is now available to subscribers. Not a subscriber? Subscribe now.
CoronaSDK 2014.2379 | Released: 24 Jul 2014, 5:28pm | What's New | Download Now

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