abs( num )
- Returns the absolute value of a number.
- num
-
- The number.
- return-value
-
- The absolute value of num.
The absolute value of a number is a number with the same magnitude, ignoring the sign.
Examples[]
print(abs(3.1)) -- 3.1
print(abs(-3.1)) -- 3.1
print(abs(0)) -- 0
See also[]