engine:functions:mathematics:sgn

sgn()

gives the sign of the given number as -1, 0 or 1

syntax

 sgn ( number: decimal ) : decimal 

parameters

number the number to get the sign of

return
return -1 for negative sign, 1 for positive sign, 0 for 0

example
sgn( 5 ) returns 1
sgn( -3 ) returns -1