Floats and rounding errors

Learn about building and using Max for Live devices.
Post Reply
pev_2
Posts: 4
Joined: Thu Sep 17, 2009 3:42 pm

Floats and rounding errors

Post by pev_2 » Thu Sep 17, 2009 11:38 pm

Hi all,

So, first proper question up from me, perhaps showing some green-ness here but if so, a quick "ignore it" answer will do :-)

I'm running through all the tutorials as a good place to get going again, and in "03mNumbersAndLists" the fourth patch sending a message of "22 33.9 -5 -44.2" generates output of "22 33.900002 -5 -44.200001". Are these rounding errors expected? If so I'd have thought a nod to them in the tutorial document would be in order.

~Pev

(Note : This is in v5.1.0a1, build 39951)

Jean-Francois Charles
Posts: 22
Joined: Sun Jun 28, 2009 5:24 pm

Re: Floats and rounding errors

Post by Jean-Francois Charles » Fri Sep 18, 2009 3:43 am

Ignore it.
(32bit floating point numbers => limited number of possible numbers => rounded to the closest...
Infinite number of threads on the subject on the Max forum, but the bottomline is most of the time, ignore it.
J-F

pev_2
Posts: 4
Joined: Thu Sep 17, 2009 3:42 pm

Re: Floats and rounding errors

Post by pev_2 » Fri Sep 18, 2009 6:01 am

Thanks for that - I'd assumed that would be the case, but has anyone submitted a report to suggest updating the documentation? Sounds like a FAQ that the tutorial should nod to...

~Pev

Post Reply