sgn

Determines the sign of a number.

sgn(number) → returns numeric

sgn Argument Reference

number numeric
Required

Examples sample code invoking the sgn function

sgn(0.3)

Expected Result: 1

sgn(0)

Expected Result: 0

sgn(-0.3)

Expected Result: -1


Fork me on GitHub