[PD] Rounding errors appear only in Windows

Roman Haefeli reduzent at gmail.com
Tue Jul 4 07:33:04 CEST 2017


On Die, 2017-07-04 at 00:11 +0200, Roman Haefeli wrote:
> Hey all
> 
> I finally figured out some bug in netpd that looked platform
> dependent.
> It turns out it actually is platform dependent. I do something that
> only creates rounding errors on Windows (or Wine), but not on Linux
> or
> macOS. 
> 
> Attached patch illustrates the issue. It pre-calculates a look-up
> table. The resulting values in the table are slightly different
> between
> platforms. On Linux, I get only integer values between 0 and 255,
> while
> on Windows get some values like 8.99996 or 256. 
> 
> Assuming, that the code for [*~ ], [/~ ] and [phasor~ ] is the same
> on
> all platforms, I wonder where the difference is coming from. Is
> Windows
> simply less smart? Can this be fixed? Is there a cleaner way to do
> what
> I want?


Actually, there is no real need to pre-calculate the table in the
signal domain. A message-based until loop gives exact results on all
platforms.


Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20170704/f8fda953/attachment.sig>


More information about the Pd-list mailing list