Difference between revisions of "Math.sign"

From GiderosMobile
(Created page with "'''Available since:''' Gideros 2022.1<br/> '''Class:''' math<br/> === Description === Returns the sign of value v. <source lang="lua"> (number) = math.sign(v) </source>...")
 
m (Text replacement - "<source" to "<syntaxhighlight")
Line 4: Line 4:
 
=== Description ===
 
=== Description ===
 
Returns the sign of value v.
 
Returns the sign of value v.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
(number) = math.sign(v)
 
(number) = math.sign(v)
 
</source>
 
</source>

Revision as of 15:28, 13 July 2023

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