Returns an integer value indicating the sign of the input value.
Syntax
SGN(Value)
Input
Value | is a value |
Domain type: | any Value domain |
Output
SGN returns: | -1 if Value<0; 0 if Value=0, and 1 if Value>0 |
Domain: | system domain Min1to1 |
Value range: | [-1,1] |
Note:
When the input value is undefined, the output will also be undefined.
Tip:
When the definition symbol = is used, a dependent output map or dependent output column is created; when the assignment symbol := is used, the dependency link is immediately broken after the output map/column has been calculated.
Usable in
MapCalc, TabCalc, Simple calculators
Examples
Pocket line calculator examples:
? SGN(12) |
returns 1 |
? SGN(POW(-2,3)) | returns -1 |
MapCalc example:
OutMap = SGN(InMap)
InMap |
OutMap |
||||||||||||||||||
|
|
TabCalc example:
OutCol = SGN(InCol)
InCol |
OutCol |
2.0 |
1 |
1.0 |
1 |
0.5 |
1 |
0.2 |
1 |
0.0 |
0 |
-1.0 |
-1 |
? |
? |
-0.4 |
-1 |
-0.1 |
-1 |
See also: