sign() Function

Function

sign( number )

Returns the number divided by its absolute value, which is 1 if the number is positive and -1 if the number is negative.

Parameters

Keyword Type Description

number

Decimal

The number that will be divided by its absolute value.

Returns

Integer

Usage considerations

If the number value is equal to zero, the function returns 1.

Examples

You can experiment with this function in the test box below.

Test Input

sign(-3) returns -1

Open in Github Built: Fri, Sep 17, 2021 (04:05:09 PM)

On This Page

FEEDBACK