Math.sign

From GiderosMobile
Revision as of 15:28, 13 July 2023 by Hgy29 (talk | contribs) (Text replacement - "<source" to "<syntaxhighlight")

Available since: Gideros 2022.1
Class: math

Description

Returns the sign of value v. <syntaxhighlight lang="lua"> (number) = math.sign(v) </source>

Parameters

v: (number) number to use for sign value

Return values

Returns (number) 1 if v is greater than 0, -1 if v is less than 0, or 0 if v is 0