Functions

abs

Supported By

Syntax

[the] abs of factor

abs ( expression )

Factor and expression yield integers, numbers, or complexes.

Example

put abs(a-b) into theDifference

Description

The abs function returns the absolute value of its argument.

If the argument is an integer, an integer is returned.

If the argument is a number, a number is returned.

If the argument is a complex, a complex is returned. The returned complex will have a real part of the distance of the passed in complex from the origin, and an imaginary part of zero.

Note

This function is similar to the hypot and radius functions, but takes one numeric argument rather than a list.