SIGN Function
Returns the sign of a value.
| Categories: | Mathematical |
| CAS |
Syntax
SIGN(argument)
Required Argument
argument
specifies a numeric constant, variable, or expression.
Details
The SIGN function returns
the following values:
-1
if argument <
0
0
if argument =
0
1
if argument >
0.
Example
The following SAS statements
produce these results:
|
SAS Statement
|
Result
|
|---|---|
x=sign(-5); |
-1 |
x=sign(5); |
1 |
x=sign(0); |
0 |
Copyright © SAS Institute Inc. All Rights Reserved.
Last updated: March 16, 2017