4.9.1. Limit Functions

absolute value

abs( x ) // = absolute value of x (also vectors)

Example:
abs( -3.156 ) // returns 3.156
abs( Ball.Pitch_X ) // returns 100.2 if the Balls x rotation is -100.2°
abs( vec( 1, -5, 69 ) ) // returns vec( 1, 5, 69 )

more about abs( x )


round

round( x ) // = rounded value of x

Example:
round( 3.99 ) // returns 4
round( 3.27 ) // returns 3

more about round( x )


truncate

trunc( x ) // = truncate float value x

Example:
trunc( 3.99 ) // returns 3
trunc( -3.67 ) // returns -3

more about trunc( x )


ceiling

ceil( x ) // = always round up x

Example:
ceil( 2.55 ) // returns 3
ceil( -3.98 ) // returns -3

more about ceil( x )


floor

floor( x ) // = always truncate x

Example:
floor( 3.99 ) // returns 3
floor( -3.67 ) // returns -4

more about floor( x )


clamp

clamp( min, max, parameter ) // = limits parameter between min and max

Example
clamp( 3, 9, 5 ) // returns 5
clamp( 3, 9, -4 ) // returns 3
clamp( 3, 9, 14 ) // returns 9


maximum

max( x ,y , ..., n ) // = maximum of x, y ... n

Example:
max( -2, 4 ) // returns 4
max( 7, 6. 5 ) // returns 7


minimum

min( x, y, ..., n ) // = minimum of x, y ... n

Example:
min( -2, 4 ) // returns -2
min( 4, 89, 1024, 2 ) // returns 2

Xpressionist 3.5