round ceiling for max 5?
Hello,
are there any externals for rounding to the ceiling for max 5?
thanks for any help.
expr int($f1)+1?
_
johan
Hi.
This won't work if the input is an integer.
There's a ceil function by Jasch, or you can use bach.expr...
... or
[expr (($f1 >= 0) * int(($f1 != int($f1)) + $f1)) + (($f1 < 0) * int ($f1))]
will do the trick (not sure it's the most clever way, though)
How about jstrigger?
[expr int($f1+0.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)]
:D
Edit:
Oh...that actually doesn't work :(
but if you don't mind the low accuracy:
expr int($f1+0.99999)
lp.scampi has ceil, floor, trunc, round, and toinf modes for converting floats to integer.
Max 5 users will want the version of lp.scampi in the Litter Pro Bundle. Lp.scampi is also included in the free Litter Start Pack, but the Starter Pack is really only happy in the Max 4 world. I may get so tired of writing this caveat that I get an updated, Max 5-friendly version of the Starter Pack out. Still, there *is* always the Pro Bundle, which is quite happy in Max 5.
thanks for suggestions guys, i wil try lp.scampi
is there anything in max 6 that does this? im surprised its not a standard expression.
[jit.ceil] ought to work, I guess.
How about:
+ 0.5
|
round
Peter,
Using 0.4999 works (for most uses) but 0.5 will round any integer up to the next integer instead of staying unchanged.
Incidentally I am looking for a floor/ceil object. I have to say it's quite annoying searching around for such basic things when they could have been implemented easily in the round object to begin with...