[PD] Displaying as two digits

Mathieu Bouchard matju at artengine.ca
Fri Apr 9 03:21:20 CEST 2010


Roman Häfeli wrote :

> Now you made it worse than it really is. Actually, it will end up as: 
> 1.23457e+06 or 1234570. It's true though, the reformatting truncates 
> significant digits. Actually, the only way I can think of to store 
> 32bit-float numbers with full precision in Pd is to write to 
> 32-bit-float soundfiles.

How about using [makefilename %.8g] ?
Together with the current bugs in atom_string, those symbols will be saved 
as full-precision floats that Pd will understand.

%.6g gives 6 decimals of precision = max 19.93 bits
%.7g gives 7 decimals of precision = max 23.25 bits
%.8g gives 8 decimals of precision = max 26.57 bits

to get full precision you need %.8g, because in float32, you have 24 bits 
of precision, which is why 16777215 is an exact float32 number, for 
example, while 16777217 is not.

  _ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801


More information about the Pd-list mailing list