PICO-8 Wiki
Advertisement
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. As of version 0.2.6b, this seems to be always 0.

Examples[]

print(sqrt(9))     -- 3

print(sqrt(0.25))  -- 0.5

See also[]

Advertisement