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

Returns

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

Examples

Example 1

This statement returns 1 (the number is positive):

Sign(5)

Example 2

This statement returns 0 (zero has no sign):

Sign(0)

Example 3

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

Sign(-5)

See also