abs()

Returns the absolute value of the given numeric expression.

This function ensures the result is always non-negative.

The abs() function is a function that returns the absolute value of a number. The absolute value of a number is the number without its sign, so if the input is a negative number, the function returns the positive version of that number. For example, abs(-5) would return 5 and abs(3) would return 3.

Syntax

abs(value)

Parameters

Parameter Type Description
value Number Value to evaluate.

Return Value

Examples

abs(-3); //returns 3

See also

abs
sign