Lipi Reference Lipi

Functions

math.sign()

The sign of `number`: -1 for a negative number and 1 for a positive one. The result is a float, not an int. Every other member that reduces a number to a whole value - math.ceil, math.floor, the one-argument math.round - returns an int, so this one is worth reading twice.

Syntax · 1 of 4

                math.sign(const float number) → const float
              

Arguments

number required const float The number to take the sign of.

Return Type

const float

Syntax · 2 of 4

                math.sign(input float number) → input float
              

Arguments

number required input float The number to take the sign of.

Return Type

input float

Syntax · 3 of 4

                math.sign(simple float number) → simple float
              

Arguments

number required simple float The number to take the sign of.

Return Type

simple float

Syntax · 4 of 4

                math.sign(series float number) → series float
              

Arguments

number required series float The number to take the sign of.

Return Type

series float