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

Returns

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

Examples

Example 1

This expression returns 1 (the number is positive):

Sign(5)

Example 2

This expression returns 0:

Sign(0)

Example 3

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

Sign(-5)