ABS(Number) ABS(Number)

Number

Number Number

The input number.

Returns

Number Number

The absolute value of the given number.

Returns the absolute value of a number. ABS(4)ABS(4) returns 4 and ABS(-4)ABS(-4) returns 4.

An absolute value does not have a sign, meaning that this function essentially removes the sign from negative values, while keeping zero and positive values as-is. The absolute value can be thought of as the value's distance from zero.

Examples

ABS(4)
ABS(4)

Returns the absolute value of 4, which is 4.

ABS(-4)
ABS(-4)

Returns the absolute value of -4, which is 4.

ABS({ 4, -4 })
ABS({ 4; -4 })

Returns the absolute values of 4 and -4 as an array: { 4, 4 }{ 4; 4 }, which is equivalent to { ABS(4), ABS(-4) }{ ABS(4); ABS(-4) }.

fxEngine Shell Want this in your own terminal? A standalone version is coming.
Loading fxEngine Shell

fxEngine Shell for your terminal

A version you install on your own computer is coming. Subscribe to the newsletter to hear when it's ready.