Forums > MaxMSP

floating point modulo in expr?

October 18, 2006 | 6:26 pm

hi,

shouldn’t it be possible to use % in expr more or less the same way
as in the % object – with floats?

thanks,

jan


October 20, 2006 | 12:29 am

Apologies if you’re making an observation and not asking for a solution, but as it doesn’t work, and possibly never will do because modulo arithmetic is for integers only, you can do this to get the remainder of a float division in expr:

[expr $f1 - ($f2 * int($f1 / $f2))]

Regards

Alex


Viewing 2 posts - 1 through 2 (of 2 total)