abs — absolute value of a number
abs(n: number) -> number
The abs function returns the absolute value of its argument n
, which
must be a numeric type.
Absolute value of a various numbers:
echo '1 -1 0 -1.0 -1(int8) 1(uint8) "foo"' | super -z -c 'yield abs(this)' -
=>
1
1
0
1.
1(int8)
1(uint8)
error({message:"abs: not a number",on:"foo"})