PICO-8 Wiki
Edit Page
Sgn

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 4: Line 4:
 
|number|required|The number to determine the sign of.
 
|number|required|The number to determine the sign of.
 
}}
 
}}
βˆ’  
== Technical Note ==
 
<code>sgn(0)</code> will return 1, not 0 as might be common on other platforms.
 
   
 
== Examples ==
 
== Examples ==
Line 14: Line 11:
 
sgn(-14) -- returns -1
 
sgn(-14) -- returns -1
 
</syntaxhighlight>
 
</syntaxhighlight>
  +
 
== Technical Note ==
 
<code>sgn(0)</code> will return 1
   
 
== See also ==
 
== See also ==

Please note that all contributions to the PICO-8 Wiki are considered to be released under the CC-BY-SA

Cancel Editing help (opens in new window)

Template used on this page: