Re: Mechanism to provide tai-utc.dat locally

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

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.

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.

--
Ashley Yakeley
Received on Wed Dec 27 2006 - 14:29:43 PST

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