sign x
sign returns the sign of the operand as -1, 0, or 1
sign
-1
0
1
sign 1 // 1 sign 100 // 1 sign 0 // 0 sign -1 // -1 sign -100 // -1
Last updated 4 years ago