Sgn

Returns the sign of a number

Syntax
      Sgn(Number)

Key
   Number  The number to return the sign of.

If number > 0, then Sgn() will return 1.
If number = 0, then Sgn() will return 0.
If number < 0, then Sgn() will return -1.

Examples

Dim intDemo
intDemo = Sgn(64)
MsgBox intDemo

“One of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs” ~ Robert Firt

Related VBScript commands

IsNumeric - Is expression a Numeric?


 
Copyright © 1999-2024 SS64.com
Some rights reserved