SIGN Function
Returns a value that represents the sign of a number.
Syntax
SIGN(number, fuzz )
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
number |
Required |
Numeric |
The number for which you want to determine the sign. |
fuzz |
Optional |
Numeric |
Specifies how close to zero the number must be in order to be considered equal to zero. |
Return value
Numeric
Remarks
The SIGN function returns 1 if number is positive, 0 if number is zero, or -1 if number is negative.
Specifyin a fuzz value helps avoid floating-point roundoff errors when a calculation is almost zero. If you do not specify a fuzz value, Visio uses 1E-9 (0.000000001). You may want to supply a different value when you scale drawings or when you want an exact comparison.
Example 1
SIGN(-5)
Returns -1.
Example 2
SIGN(0)
Returns 0.
Example 3
SIGN(0.00000000001)
Returns 0.
Example 4
SIGN(0.00000000001,0)
Returns 1.