floor function

Dg's icon

Hello,

Do we have a "floor" like C function in Max that round a float number to the previous integer?

thx!

jvkr's icon

Converting to an int will just do that.

Dg's icon

Yes! Basic.

.. and I just found the [floor] jasch external ...

Peter Castine's icon

In the interest of full disclosure: lp.scampi supports floor, ceiling, round to zero, round to infinity, and "conventional" rounding.

lp.scampi's primarily there for scaling/mapping and the rounding options are just a bonus feature. But it's nice to know they're there.

Dimitri Aatos's icon

Beware, converting to int works like the floor function only for positive numbers. Negative numbers are shifted by +1 e.g. -0.5 converted to an int becomes 0, floor(-0.5) however returns -1.

Roman Thilenius's icon

min() or floor(round())