sign

 
 
 

Returns one of three values representing the sign of a number. Returns -1 if the number is negative, 1 if positive, 0 if 0.

float sign( float number )

number is the number whose sign you want to determine.

Examples

sign(-9.63)

Returns -1.

sign(0)

Returns 0.

sign(10)

Returns 1.

sign(Ball.translateX)

If Ball.translateX is 5, this returns 1.