[PD] "wrong" floating point values in pyext

Tim Blechmann TimBlechmann at gmx.net
Mon Feb 20 11:53:09 CET 2006


> However if I set this float x to a floating point value like "0.02",
> Pd will print a value that is only near the target value: 
> 
> "x 0.2" results in a printout of 0.20000000298
> 
> Is there something wrong? 

IEEE 754 floating point numbers aren't able to encode 0.2 ... pd's
print is rounding to 6 digits, python doesn't round, though ...

see http://en.wikipedia.org/wiki/IEEE_floating-point_standard for
details ...

tim

-- 
mailto:TimBlechmann at gmx.de    ICQ: 96771783
http://www.mokabar.tk

Desperation is the raw material of drastic change. Only those who can
leave behind everything they have ever believed in can hope to escape.
  William S. Burroughs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20060220/7ddf7ce0/attachment.pgp>


More information about the Pd-list mailing list