Sqrt

From Pico-8 Wiki
Jump to navigation Jump to search
sqrt( num )
Calculates the square root of a number.
num
The number. Must be positive.

The sqrt() function calculates the square root of a positive number.

When given a negative number, sqrt() returns a result, but it isn't useful.

Examples

print(sqrt(9))     -- 3

print(sqrt(0.25))  -- 0.5

See also