Re: [LEAPSECS] Mechanism to provide tai-utc.dat locally

From: Poul-Henning Kamp <phk_at_PHK.FREEBSD.DK>
Date: Wed, 27 Dec 2006 22:32:17 +0000

In message <>, Ashley Yakeley
>On Dec 27, 2006, at 06:29, Poul-Henning Kamp wrote:
>> That's a pretty bad format. Computers are binary and having
>> pseudo-decimal fields like tv_usec in timeval, tv_nsec in timespec
>> and picoseconds in Haskell is both inefficient and stupid.
>> The fractional part should be a binary field, so that the width
>> can be adjusted to whatever precision and wordsize is relevant.
>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.

>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.


Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk_at_FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
Received on Wed Dec 27 2006 - 14:42:49 PST

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