--------
In message <89326.1421483...@critter.freebsd.dk>, "Poul-Henning Kamp" writes:

>I played a bit with the idea this morning, and I think this is how I would
>do it:
>
>   +-------+-----------+-----+---------------------+---------------+
>   |1 1 1 1|M M M M M M M M M|L L L L L L L L L|D D|C C C C C C C C|
>   +-------+-----------+-----+---------------------+---------------+
>    3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 
>    1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0

I botched that figure (Thanks Harlan) and after thinking a bit more
about it I think this is better:

    +-------+---------------------+-----------------+---------------+
    |1 1 1 1|M M M M M M M M M M M|L L L L L L L|D D|C C C C C C C C|
    +-------+---------------------|-----------------+---------------+
     3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 

11 bits for Month is good until 2142

7 signed bits for TAI-UTC, if leaps continue at the "traditional"
18-36 month rate, are good for 40-80 years. 

We can extend that range by making the before count:

        (year - 1972) + L

Or probably even:

        (year - 1972) + L - constant

Using one leap-second per year as estimate has the advantage that
it doesn't involve any fractions which has to be rounded.)

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
p...@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.
_______________________________________________
LEAPSECS mailing list
LEAPSECS@leapsecond.com
https://pairlist6.pair.net/mailman/listinfo/leapsecs

Reply via email to