Max is changing the values of my floats

Oct 15, 2008 at 2:04pm

Max is changing the values of my floats

Hi,

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?

#40350
Oct 15, 2008 at 2:31pm

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.

lh

#142660
Oct 15, 2008 at 2:35pm

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

ftp://arts.ucsc.edu/pub/ems/MaxTutors/

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

lh

#142661
Oct 15, 2008 at 3:11pm

That’s another penny for Peter Castine…

#142662

You must be logged in to reply to this topic.