SIGN Function

Purpose

Returns a 1, -1, or 0, indicating whether the specified value is positive, negative, or zero, respectively.

Syntax

SIGN(x)

Parameters

x is an arithmetic expression.

Description

The SIGN function returns a 1, -1, or 0, indicating whether x is positive, negative, or zero, respectively.

The precision of the result is determined by the -bifprec compiler option.

Examples

IF SIGN(X) = 1 THEN
   PUT LIST ('SIGN OF X IS POSITIVE');

Restrictions

None.