Hi I need PD to make simple but accurate calculations for a sonification project. However there seems to be a problem working accurately with floats that have 7 or more digits in total (before or after the decimal point). PD always seem to round the figure to 6 digits whether in a calculation, or even typing a 7+ digit float into a number box e.g. 1234.5678 rounded to 1234.57
I've got a couple of ugly hacks to work around for now, but it seems a fairly fundamental thing to do, so would be grateful to hear if I'm missing a simple way to get PD to work accurately with floats of any arbitrary length above 6 digits.
Cheers
Mark
On Thu, Nov 06, 2008 at 10:50:51PM +0000, Mark Sexton wrote:
Hi I need PD to make simple but accurate calculations for a sonification project. However there seems to be a problem working accurately with floats that have 7 or more digits in total (before or after the decimal point). PD always seem to round the figure to 6 digits whether in a calculation, or even typing a 7+ digit float into a number box e.g. 1234.5678 rounded to 1234.57
have you the size of numbox set to '0' ?
I've got a couple of ugly hacks to work around for now, but it seems a fairly fundamental thing to do, so would be grateful to hear if I'm missing a simple way to get PD to work accurately with floats of any arbitrary length above 6 digits.
i think there is octave object, try and see if that could give any different results, but i doubt it would ;)
Cheers
Mark
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Mark Sexton wrote:
Hi I need PD to make simple but accurate calculations for a sonification project. However there seems to be a problem working accurately with floats that have 7 or more digits in total (before or after the decimal point). PD always seem to round the figure to 6 digits whether in a calculation, or even typing a 7+ digit float into a number box e.g. 1234.5678 rounded to 1234.57
I've got a couple of ugly hacks to work around for now, but it seems a fairly fundamental thing to do, so would be grateful to hear if I'm missing a simple way to get PD to work accurately with floats of any arbitrary length above 6 digits.
you don't need anything. Pd does uses IEEE floating point values for numbers, you don't loose a single bit. it's only the GUI that likes to round the numbers when displaying it. internally everything is "correct" (as far as it is possible using single precision floats)
you could change the "width" of a number-box to see more digits.
fgmasdr IOhannes
On Fri, Nov 07, 2008 at 09:45:32AM +0100, IOhannes m zmoelnig wrote:
Mark Sexton wrote:
Hi I need PD to make simple but accurate calculations for a sonification project. However there seems to be a problem working accurately with floats that have 7 or more digits in total (before or after the decimal point). PD always seem to round the figure to 6 digits whether in a calculation, or even typing a 7+ digit float into a number box e.g. 1234.5678 rounded to 1234.57
I've got a couple of ugly hacks to work around for now, but it seems a fairly fundamental thing to do, so would be grateful to hear if I'm missing a simple way to get PD to work accurately with floats of any arbitrary length above 6 digits.
you don't need anything. Pd does uses IEEE floating point values for numbers, you don't loose a single bit. it's only the GUI that likes to round the numbers when displaying it. internally everything is "correct" (as far as it is possible using single precision floats)
actually i have thought if pd could be ported to use double precision? may be optionaly so if your machine is meant to be fast enough then you opt doubles .. is it quite doable?
you could change the "width" of a number-box to see more digits.
fgmasdr IOhannes
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On 7 Nov 2008, at 5:53 PM, errordeveloper@gmail.com wrote:
actually i have thought if pd could be ported to use double precision? may be optionaly so if your machine is meant to be fast enough then
you opt doubles .. is it quite doable?
what is the new situation with 64-bit compatible pd in 0.41 ??
simon
Simon Wise wrote:
On 7 Nov 2008, at 5:53 PM, errordeveloper@gmail.com wrote:
actually i have thought if pd could be ported to use double precision? may be optionaly so if your machine is meant to be fast enough then
you opt doubles .. is it quite doable?what is the new situation with 64-bit compatible pd in 0.41 ??
there is no new situation. 0.41 has always been 64bit compatible.
fgamr IOhannes
IOhannes m zmoelnig wrote:
Simon Wise wrote:
On 7 Nov 2008, at 5:53 PM, errordeveloper@gmail.com wrote:
actually i have thought if pd could be ported to use double precision? may be optionaly so if your machine is meant to be fast enough then
you opt doubles .. is it quite doable?what is the new situation with 64-bit compatible pd in 0.41 ??
there is no new situation. 0.41 has always been 64bit compatible.
but with respect to single vs double precision floats this doesn't change anything. since on 64bit archs, a t_atom is 64bit (+overhead) wide, it might be a good idea to switch to double here, at least in message domain. (but i'm not sure whether signal and message precision should be different (as is in max))
fgamsdr IOhannes
errordeveloper@gmail.com wrote:
On Fri, Nov 07, 2008 at 09:45:32AM +0100, IOhannes m zmoelnig wrote:
Mark Sexton wrote:
Hi I need PD to make simple but accurate calculations for a sonification project. However there seems to be a problem working accurately with floats that have 7 or more digits in total (before or after the decimal point). PD always seem to round the figure to 6 digits whether in a calculation, or even typing a 7+ digit float into a number box e.g. 1234.5678 rounded to 1234.57
I've got a couple of ugly hacks to work around for now, but it seems a fairly fundamental thing to do, so would be grateful to hear if I'm missing a simple way to get PD to work accurately with floats of any arbitrary length above 6 digits.
you don't need anything. Pd does uses IEEE floating point values for numbers, you don't loose a single bit. it's only the GUI that likes to round the numbers when displaying it. internally everything is "correct" (as far as it is possible using single precision floats)
actually i have thought if pd could be ported to use double precision? may be optionaly so if your machine is meant to be fast enough then you opt doubles .. is it quite doable?
there has been quite some code added to Pd-0.42 in preperation to make single/double precision a compile-time option.
i think the only major thing that is still missing for a fully functional double-precision Pd is some ugens, namely [phasor~], [cos~] and [osc~].
and of course most externals will not work properly.
fgmasdr IOhannes
On Fri, Nov 07, 2008 at 10:21:19AM +0100, IOhannes m zmoelnig wrote:
there has been quite some code added to Pd-0.42 in preperation to make single/double precision a compile-time option.
that's the way forward ;_)
i think the only major thing that is still missing for a fully functional double-precision Pd is some ugens, namely [phasor~], [cos~] and [osc~].
and of course most externals will not work properly.
right ..sure, i was thinking it's just a metter of changing the header ..
also then someone (like me) wishes to have the double precision sample stored in soundfile too ;) actually i see that my editor (Snd) can handle it very esealy :)) i really need sndlib instead of pd's audiofiler ..
fgmasdr IOhannes
On Fri, 2008-11-07 at 09:45 +0100, IOhannes m zmoelnig wrote:
Mark Sexton wrote:
Hi I need PD to make simple but accurate calculations for a sonification project. However there seems to be a problem working accurately with floats that have 7 or more digits in total (before or after the decimal point). PD always seem to round the figure to 6 digits whether in a calculation, or even typing a 7+ digit float into a number box e.g. 1234.5678 rounded to 1234.57
I've got a couple of ugly hacks to work around for now, but it seems a fairly fundamental thing to do, so would be grateful to hear if I'm missing a simple way to get PD to work accurately with floats of any arbitrary length above 6 digits.
you don't need anything. Pd does uses IEEE floating point values for numbers, you don't loose a single bit. it's only the GUI that likes to round the numbers when displaying it. internally everything is "correct" (as far as it is possible using single precision floats)
you could change the "width" of a number-box to see more digits.
still only 6 digits are displayed. altough pd works internall with IEEE 32bit floating values, i couldn't think of an easy way to get them out of pd. both, print and the numberbox truncate the numbers.
two ways - not very feasible, though - to get full precision out of pd come to my mind:
numbers from there
or has someone a better idea?
roman
___________________________________________________________ Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de
I've had the 6-digit problem trying to print UTM position coordinates
out of Pd.
If you know the range of your numbers, there are some ugly hacks that
provide a limited solution.
Eg, for 1234.5678 you can pass the number through [int] and then
subtract that from the original number to get the parts before and
after the decimal, then print them separately and use external scripts
to concatenate - or maybe you could convert them to symbols and
concatenate in Pd before printing.
You could do similar things using [mod] for numbers above 1e+06, etc...
Nick
On Nov 7, 2008, at 10:08 AM, Roman Haefeli wrote:
On Fri, 2008-11-07 at 09:45 +0100, IOhannes m zmoelnig wrote:
Mark Sexton wrote:
Hi I need PD to make simple but accurate calculations for a
sonification project. However there seems to be a problem working
accurately with floats that have 7 or more digits in total (before
or after the decimal point). PD always seem to round the figure to
6 digits whether in a calculation, or even typing a 7+ digit float
into a number box e.g. 1234.5678 rounded to 1234.57I've got a couple of ugly hacks to work around for now, but it
seems a fairly fundamental thing to do, so would be grateful to
hear if I'm missing a simple way to get PD to work accurately with
floats of any arbitrary length above 6 digits.you don't need anything. Pd does uses IEEE floating point values for numbers, you don't
loose a single bit. it's only the GUI that likes to round the numbers when displaying it. internally everything is "correct" (as far as it is possible using single precision floats)you could change the "width" of a number-box to see more digits.
still only 6 digits are displayed. altough pd works internall with
IEEE 32bit floating values, i couldn't think of an easy way to get them out of pd. both, print and the numberbox truncate the numbers.two ways - not very feasible, though - to get full precision out of pd come to my mind:
- send the numbers over OSC to some other application
- write the numbers to an audio file with 32bit bitlength. extract the
numbers from there
or has someone a better idea?
roman
___________________________________________________________ Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo!
Mail: http://mail.yahoo.de
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list