Difference between revisions of "Larger and Smaller Operators"

From GiderosMobile
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 +
<!-- GIDEROSOBJ:Larger and Smaller Operators -->
 
'''<translate>Supported platforms</translate>:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]]<br/>
 
'''<translate>Supported platforms</translate>:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]]<br/>
 
'''<translate>Available since</translate>:''' Gideros 2017.10<br/>
 
'''<translate>Available since</translate>:''' Gideros 2017.10<br/>

Revision as of 15:55, 31 August 2018

Supported platforms: Platform android.pngPlatform ios.pngPlatform mac.pngPlatform pc.png
Available since: Gideros 2017.10

Description


Operators to return the larger or smaller of two values.

a <> b   Compare 'a' and 'b', return the larger of them.
a >< b   Compare 'a' and 'b', return the smaller of them.

Examples

Simple larger examples

 
x=a&lt;&gt;b -- faster than x=math.max(a,b)
x=(x-1)&lt;&gt;5 -- decrement x, but don't go below 5

Simple smaller examples

 
x=a&gt;&lt;b -- faster than x=math.min(a,b)
x=(x+1)&gt;&lt;15 -- increment x, but don't go above 15

Make sure x is within bounds example

 
x=(x&lt;&gt;min)&gt;&lt;max

Always return the negative of a number

 
x=-x&gt;&lt;x -- faster than -math.abs

Always return the positive of a number

 
x=-x&lt;&gt;x -- faster than math.abs

Methods

Events

Constants