Larger and Smaller Operators

From GiderosMobile

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


Operators to return the larger or smaller of two values.

a<>b   compares 'a' and 'b', returns the larger of them.

a><b   compares 'a' and 'b', returns the smaller of them.


Simple larger examples

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

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


Always return the negative of a number

x=-x><x -- faster than -math.abs

Always return the positive of a number

x=-x<>x -- faster than math.abs