Forums > MaxMSP

Regexp adds decimal points?

October 11, 2012 | 7:38 pm

I’m trying to use Michael Todd’s patch for translating and sending MSC light commands but the float I send to it gets modified and 5 decimal points are added to the value. This makes the patcher unusable as it converts all these points and ends up llonger than the 9 value limit of the sxformat object. Is this a new bug in MAX or am I missing something?

here is the problematic part, see how the 90.1 suddenly becomes 90.099998

— Pasted Max Patch, click to expand. —
October 12, 2012 | 5:19 pm

well I took a shower and found a workaround. Here is the modified path:

— Pasted Max Patch, click to expand. —
October 13, 2012 | 10:34 pm

If you Google something like "float precision" you will find gazillions of posts explaining the workings of binary floating point. It’s not actually a Max issue, it’s nothing new, and it’s a feature not a bug.

Peter Elsea’s tutorial on the subject is highly recommended.

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

Forums > MaxMSP