From ... From: Erik Naggum Subject: Re: Waving the lambda flag again (was: Constants and DEFCONSTANT) Date: 1999/04/07 Message-ID: <3132514507164896@naggum.no>#1/1 X-Deja-AN: 463815704 References: <7dr23c$2re$1@shell5.ba.best.com> <3131961221139730@naggum.no> <4niubflwhf.fsf@rtp.ericsson.se> <41UM2.19154$134.197089@tor-nn1.netcom.ca> <3132042770550791@naggum.no> <3132050414299555@naggum.no> <3132487825915707@naggum.no> <4npv5guv18.fsf@rtp.ericsson.se> mail-copies-to: never Organization: Naggum Software; +47 8800 8879; http://www.naggum.no Newsgroups: comp.lang.lisp * Raymond Toy | 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