syntax:functions:sign
This is an old revision of the document!
Table of Contents
Sign(number)
Category: Number function
Description
This function determines whether number is positive, negative, or zero. If positive the value 1 is returned. If negative, the value -1 is returned. If number is 0, then 0 is returned.
Arguments
Argument | Type | Description |
---|---|---|
number | Number | The value being tested as positive, negative or zero. |
Return value type: Number (1, -1, or 0)
Remarks
An expression that results in a numeric answer can be used as the number argument. In this case, the result of the expression is tested.
Examples
sign(27) = 1 sign(-42) = -1 sign(0) = 0 sign(14*-3) = -1 sign(88 * 0) = 0 sign(12 * 3) = 1
syntax/functions/sign.1627848816.txt.gz · Last modified: 2021/08/01 16:13 by craigt