In message <[EMAIL PROTECTED]>, Zefram writes:
>Ashley Yakeley wrote:

>>In the Haskell time library, I represent UTC time by what seemed to
>>me the simplest possible correct type. This is a record containing an
>>integer to represent day number (as MJD), and a fixed-point decimal
>>(picosecond resolution) to represent seconds since midnight. The
>>allowed range for this is 0 to 86400.999999999999.
>That's a pretty good format.

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.

Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED]         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.

Reply via email to