?
-
How to calculate with higher precision?
-
I bet if you save that patch, close it and reopen, you'll find that the message box has changed to the lower precision.
AFAIK Pd simply doesn't have double precision floats, so a smart-alecky answer would be "use another programming environment with double precision." I'd be happy to hear that I'm wrong though.
hjh
-
@lacuna I think you would have to compile pd with double precision. Fairly simple to do and a search should answer all your questions if you are not much for building from source, but it apparently still has some bugs.
-
it isn't just a matter of double precision, it's also a matter of printing the right amount of characters. But iirc if you compile pd for double precision that might already be set up
edit: thesprintf
function pd uses to get the characters from the binary value (inatom_string
inm_atom.c
) gives 6 (decimal) digits of precision by default. -
@seb-harmonik.ar said:
it's also a matter of printing the right amount of characters [...]
sprintf
[...] gives 6 (decimal) digits of precision by default.Just found that the truncation of two digits earlier than single precision really is the printing only:
in this patch, if you enter
1.999999
prints 2
outputs left
1.9999999
prints 2
outputs left
1.99999999
prints 2
outputs rightlate edit: symbols without sprintf truncation: https://forum.pdpatchrepo.info/topic/709/symbol-to-float-conversion/17
-
in 32 bit max/msp you could expr for that.
because expr is not only 64 bit inside and give you a higher precision result from a complex function - it will also save the long form you typed in, since it is characters and not numbers.
[expr 1.23456789]