SIGN

All functions > MATH > SIGN

Returns the sign of a number: -1 for negative, 0 for zero, and 1 for positive.

Syntax

SIGN(expr)
sql

Arguments

ParameterTypeRequiredDescription
numberDOUBLEYesThe number to get the sign of

Returns

BIGINT - Sign indicator (-1, 0, or 1)

Notes

  • Returns -1 for any negative number
  • Returns 0 for zero (positive or negative zero)
  • Returns 1 for any positive number
  • Returns NULL if the input is NULL
  • Useful for conditional logic based on number sign

Examples

Last update at: 2025/10/13 10:23:46