[PD] numbers seem to be wrongly adding up

rolfm at dds.nl rolfm at dds.nl
Fri May 21 11:19:07 CEST 2021

thanks Roman for replying 

i had the, apparently, wrong idea that it were the big numbers giving
problems when using floating point arithmetic. 

now, after reading up about the 'perils of floating point' i have to
rethink my method of calculation. 


Roman Haefeli wrote: 

>>The intricacies of 32bit floating point numbers have been discussed up 

>>and down on this list.

>>tldr; many decimal numbers do not have an exact floating point
>>representation. Incrementing with such numbers increases the error on
>>each iteration

>>Suggestion: Count with integer numbers and scale afterwards.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20210521/7dfca188/attachment-0001.htm>

More information about the Pd-list mailing list