Re: Mechanism to provide tai-utc.dat locally

From: Ashley Yakeley <ashley_at_SEMANTIC.ORG>
Date: Wed, 27 Dec 2006 14:55:00 -0800

On Dec 27, 2006, at 14:32, Poul-Henning Kamp wrote:

>> It's impossible to accurately represent a millisecond using binary
>> fractions. That would be unacceptable for most sub-second use.
> Reality check: with a 32bit fraction, the error would be 69 ps.

...which accumulates in arithmetic and causes equality comparisons to
fail. This should hold:

    1000 * 1ms == 1s

It won't if you use a binary fraction.

>> A better idea might have been to use Haskell's "Rational" type for
>> the seconds offset, which is stored as two integers (for numerator
>> and denominator). Instead I used a fixed-point type (internally just
>> an integer from 0 to 86400999999999999). It does not separate
>> "integer" and "decimal" part.
> Yes, let us make it as expensive as possible to operate on timestamps,
> so that everybody will have to invent their own faster type.
> NOT!

I'm not seeing the problem here: you can represent an integer in the
range 0 to 86400999999999999 with a 64-bit type. There's nothing
faster than integer arithmetic.

Ashley Yakeley
Received on Wed Dec 27 2006 - 14:55:18 PST

This archive was generated by hypermail 2.3.0 : Sat Sep 04 2010 - 09:44:55 PDT