Sign

Syntax

sign x

Explanation

sign returns the sign of the operand as -1, 0, or 1

Examples

sign 1    // 1
sign 100  // 1
sign 0    // 0
sign -1   // -1
sign -100 // -1

Last updated