Regexp adds decimal points?

Oct 11, 2012 at 7:38pm

Regexp adds decimal points?

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. –
Oct 12, 2012 at 5:19pm

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

– Pasted Max Patch, click to expand. –
Oct 13, 2012 at 10:34pm

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.


You must be logged in to reply to this topic.