Abs

Description

Calculates the absolute value of a number.

Syntax

Abs ( n )

Argument

Description

n

The number for which you want the absolute value

Returns

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

Examples

Example 1

All these statements set num to 4:

integer i, num

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

Example 2

This statement returns 4.2:

Abs(-4.2)

See also