Sign

Description

Reports whether the number is negative, zero, or positive by checking its sign.

Syntax

Sign ( n )

Argument

Description

n

The number for which you want to determine the sign


Return value

Integer. Returns a number (-1, 0, or 1) indicating the sign of n.

Examples

This expression returns 1 (the number is positive):

Sign(5)

This expression returns 0:

Sign(0)

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

Sign(-5)