Sign

Description

Reports whether a number is negative, zero, or positive.

Syntax

Sign ( n )

Argument

Description

n

The number for which you want to find out the sign


Return value

Integer.

Returns a number (-1, 0, or 1) indicating the sign of n. If n is null, Sign returns null.

Examples

This statement returns 1 (the number is positive):

Sign(5)

This statement returns 0 (zero has no sign):

Sign(0)

This statement returns -1 (the number is negative):

Sign(-5)

See also

Sign method for DataWindows in the section called “Sign” in DataWindow Reference.