abs
Syntax Format
abs(x)
Overview
The abs
function provides the absolute value for the indicated number. The absolute value is always a positive number or 0, regardless of the initial type sign. This function might be helpful in scripts, where the sign of a number is not relevant, and just a value is needed.
Parameters
Parameter | Type | Purpose |
---|---|---|
x | series or numeric | A given type to receive an absolute value of |
Returns: same type as x.
Example
value1 = abs(-1) -- equals 1
value2 = abs(0) -- equals 0
value3 = abs(1) -- equals 1
value4 = abs(10.5) -- equals 10.5