Sgn

Determine the sign of a number

Method Signature

Sgn(number=[numeric])

Arguments

Argument
Type
Required
Description
Default

number

numeric

true

The number to determine the sign of.

Examples

Sign of any number greater than 0

Run Example

sgn( .3 );

Result: 1

Sign of 0

Run Example

sgn( 0 );

Result: 0

Sign of any number less than 0

Run Example

sgn( -.3 );

Result: -1

Additional Examples

15 = <bx:output>#sgn( 15 )#</bx:output><br>
-15 = <bx:output>#sgn( -15 )#</bx:output>

Last updated

Was this helpful?