[PD] working with integers

rolfm at dds.nl rolfm at dds.nl
Wed May 26 10:38:32 CEST 2021


rolfm at dds.nl schreef op 25-05-2021 23:16:

> hi, 
> 
> because of the problems i had with calculations using floating point math, 
> 
> and following Roman's advice, i changed to integer math. 
> 
> however that's easier said then done. 
> 
> i'm running again into an unexpected limitation: 
> 
> 32-bits can represent signed integers upto 2.147...billion. 
> 
> however, as soon as a number is greater then binary 27 bits the last byte stays 0.( after 134217727 ) 
> 
> e.g. 134200000 + 25000 = 134224992 (should be 134225000). 
> 
> what am i missing? 
> 
> rolf

correction: the difference is 8, so it's the last 4 bits that are
involved.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20210526/b7a2bac0/attachment.htm>


More information about the Pd-list mailing list