Skip to main content

sign

Returns the sign of a number (1 if positive, -1 if negative, and 0 if zero).

Parameters

  • X (number)

    The input number.

Examples

ATL in Script

Result

[[sign(5.5)]]

1

[[sign(-5.5)]]

-1

[[sign(0)]]

0

[[sign(-0)]]

0

[[sign(0.0)]]

0

[[sign(-0.0)]]

0

[[sign(0.01)]]

1

[[sign(-0.01)]]

-1