Subject: Re: Waving the lambda flag again (was: Constants and DEFCONSTANT)
From: Erik Naggum <erik@naggum.no>
Date: 1999/04/07
Newsgroups: comp.lang.lisp
Message-ID: <3132514507164896@naggum.no>

* Raymond Toy <toy@rtp.ericsson.se>
| Since there are (* 24 60 60) = 86400 possible values for
| hour-minute-second, and they're all equally likely, I don't see how
| you can take much less than 17 (= log2(86400)) bits for this.

  the whole idea is to avoid division by table lookups.  therefore, we're
  talking about a means to ensure that the bits of a fixnum can hold 24
  hours, 60 minutes, and 60 seconds in separate bytes, or 400 years, 12
  months, and 31 days in separate bytes.  then define a simple vector of
  precomputed values indexed by the undivided value.

| Obviously, there's some redundancy I'm overlooking.  And of course,
| with this type of encoding, you have to do all sorts of divisions to
| get the individual pieces out, but that may not be so bad if the
| machine has integer division built in.

  division was the _primary_ cost in the algorithm...

#:Erik