Garry's Mod Wiki

math.Sign

  number math.Sign( number value )

Recently Added

This was recently added in version (2026.05.25). It might only be available on the Dev Branch right now.

Description

Returns the mathematical negative/positive sign of the input number.

Arguments

1 number value
The input number.

Returns

1 number
-1 for inputs of less than 0, 0 if given a 0, 1 for inputs above 0.