Larger and Smaller Operators
From GiderosMobile
Supported platforms: android, ios, mac, pc
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
<br />
x=a<>b -- faster than x=math.max(a,b)
x=(x-1)<>5 -- decrement x, but don't go below 5
Simple smaller examples
<br />
x=a><b -- faster than x=math.min(a,b)
x=(x+1)><15 -- increment x, but don't go above 15
Make sure x is within bounds example
<br />
x=(x<>min)><max
Always return the negative of a number
<br />
x=-x><x -- faster than -math.abs
Always return the positive of a number
<br />
x=-x<>x -- faster than math.abs
Methods |
EventsConstants |