[PD] Rounding errors appear only in Windows

Roman Haefeli reduzent at gmail.com
Tue Jul 4 00:11:16 CEST 2017


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?

Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: windows-rounding-error.pd
Type: text/x-puredata
Size: 1306 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20170704/bfcd9e0f/attachment-0001.bin>
-------------- 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/bfcd9e0f/attachment-0001.sig>


More information about the Pd-list mailing list