FANDOM


abs( num )
Returns the absolute value of a number.
num
The number.

The absolute value of a number is a number with the same magnitude, ignoring the sign.

Examples Edit

print(abs(3.1))   -- 3.1
 
print(abs(-3.1))  -- 3.1
 
print(abs(0))     -- 0

See also Edit

Community content is available under CC-BY-SA unless otherwise noted.