4.9.1.3 truncate - trunc( x )

The truncate function returns the truncated value of the argument. This means that the function cuts off all floating point values of the argument and returns an iteger instead. All floating point values will be cut off regardless of their value - e.g. the argument 2.9 will be truncated and the function will return 2.

sphere.YPosition = trunc( sin( time * 90 ) * 2 );

This will cutoff all floating point values of the wave and return stairsteps.

Since the trunc function truncates the values of the sine curve we don't get a smooth transition anymore but abrupt shifts between integers.

The red curve represents the values of the argument. The blue curve represents the output of the trunc function.

Xpressionist 3.5