Abs

Description

Calculates the absolute value of a number.

Syntax

Abs ( n )

Argument

Description

n

The number for which you want the absolute value


Return value

The datatype of n. Returns the absolute value of n. If n is null, Abs returns null.

Examples

All these statements set num to 4:

integer i, num

i = 4
num = Abs(i)
num = Abs(4)
num = Abs(+4)
num = Abs(-4)

This statement returns 4.2:

Abs(-4.2)

See also

Abs method for DataWindows in the section called “Abs” in DataWindow Reference