[PD] [epochtime] - my first external

Thomas Grill t.grill at gmx.net
Wed Nov 20 11:18:13 CET 2002


> In any case, I don't think this object will be of any use to anybody because
> PD returns the following number: 1.03777e+009 (or something like it) which
> can't be used very reliably.  I mean it works, but I can't see the seconds
> pass -- i can only observe the passage of time every 64 seconds or so.
> (What I mean is that the object will output the same number for about 64
> seconds, then it outputs another number which is slightly higher.)
> 
> Perhaps Miller has an answer to this?  I know that the floating point values
> in PD are limited to a specific range -- is that the cause of this
> phenomenon.?

Hi David, i'm not Miller but i can answer this:
In PD all numeric values are represented by single precision floats having
24 bits of mantissa, which translates to a accuracy of about 7 or 8 decimal
digits.
Hence, a number of the order 1e+9 cannot be represented with full accuracy.

Depending on what you are using your external for, you can possibly
circumvent the problem by storing the value of time(NULL) with full
precision either at class or object setup and then, at a bang, output only
the difference between the current time(NULL) and this stored value.


best greetings,
Thomas






More information about the Pd-list mailing list