hi, i'm trying to use the gps object in Pd as part of an RjDj scene and their forum is down at the moment so i thought i'd look for help here...
so pd has a limit on the size of numbers it can use and i'm looking for a simple way to break them down, (as i'm using RjDj i have to use the vanilla pd so no extra object fun). The GPS object apparently sends out numbers to 6 decimal places, (e.g. 51.430023) which keeps causing problems in other parts of the patch. I have tried removing the integer before the point and multiplying by 10000 to give me something manageable. In the above example I would expect to get 4300.23 but instead i get something like 4300.23XXXX, where are these extra numbers coming from? Can anyone suggest a better way to deal with this data?
regards
duncan
try:
[* 1000000] | [+ 0.5] | [int]
what that does, is convert the 6 decimal place number into an integer, then you add 0.5 so that the rounding goes to the nearest integer, and then you use [int] to chop off any remaining overflow.
On Mon, Apr 12, 2010 at 2:07 AM, duncan speakman < duncan.kleindesign@gmail.com> wrote:
hi, i'm trying to use the gps object in Pd as part of an RjDj scene and their forum is down at the moment so i thought i'd look for help here...
so pd has a limit on the size of numbers it can use and i'm looking for a simple way to break them down, (as i'm using RjDj i have to use the vanilla pd so no extra object fun). The GPS object apparently sends out numbers to 6 decimal places, (e.g. 51.430023) which keeps causing problems in other parts of the patch. I have tried removing the integer before the point and multiplying by 10000 to give me something manageable. In the above example I would expect to get 4300.23 but instead i get something like 4300.23XXXX, where are these extra numbers coming from? Can anyone suggest a better way to deal with this data?
regards
duncan
-- http://duncanspeakman.net http://subtlemob.com
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On 2010-04-11 19:07, duncan speakman wrote:
hi, i'm trying to use the gps object in Pd as part of an RjDj scene and their forum is down at the moment so i thought i'd look for help here...
so pd has a limit on the size of numbers it can use and i'm looking
well, Pd has no such limit. it's your computer that has. (Pd could use higher precision maths though, which it currently doesn't)
for a simple way to break them down, (as i'm using RjDj i have to use the vanilla pd so no extra object fun). The GPS object apparently sends out numbers to 6 decimal places, (e.g. 51.430023) which keeps causing problems in other parts of the patch. I have tried removing the integer before the point and multiplying by 10000 to give me something manageable. In the above example I would expect to get 4300.23 but instead i get something like 4300.23XXXX, where are these extra numbers coming from?
most likely they come from floating point numbesr and 2^n representations. http://en.wikipedia.org/wiki/Floating_point #Representable_numbers.2C_conversion_and_rounding
however, i don't see any particular problem with the "extra" numbers you get
mfgasdr IOhannes