Forums > MaxMSP

Max is changing the values of my floats

Oct 15 2008 | 2:04 pm


I’ve noticed that sometimes in copying or printing floats with many decimal places that Max will change the value slightly. (In the same way, floats with >6 decimal places will be truncated to the 6th decimal.)

Like now I am working with a message that contains the float 66.54321, and when I copy or print this message, it changes, to read 66.543213. It’s not a big deal for my current patch but in general I’d like the floats I type in to remain the way I intend them. What may be a solution to this minor dilemma?

Oct 15 2008 | 2:31 pm

This has been mentioned here a fair few times. Due to the nature of representing floating point numbers in binary it is impossible to have every value represented so your number is nudged to the nearest one that 32bit can handle.


Oct 15 2008 | 2:35 pm

Have a look at Peter Elsea’s tutorials for more information.

The one you’re looking for is Max&Numbers.pdf but the others are all worth a read too.


Oct 15 2008 | 3:11 pm

That’s another penny for Peter Castine…

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

Forums > MaxMSP