Message-ID: <32FFC543.1137@trellis.net>
Date: Mon, 10 Feb 1997 20:02:59 -0500
From: phma@trellis.net
X-Mailer: Mozilla 3.01Gold (Win95; I)
MIME-Version: 1.0
Newsgroups: comp.lang.lisp,sci.crypt,comp.lang.c
Subject: Re: Fast Algorithm
References: <hbaker-0302971702490001@10.0.2.1> <32F79D23.74DA@smarts.com>
			<AF1EB044966814C6B@bifroest.demon.co.uk> <3jvi85es6t.fsf@Np.nosc.mil>
			<hbaker-0602972113200001@10.0.2.1> <3j20asa5my.fsf@Np.nosc.mil> <32FBD28F.2921@cableol.co.uk>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: user38.trellis.net
Lines: 17
Path: cantaloupe.srv.cs.cmu.edu!nntp.club.cc.cmu.edu!miner.usbm.gov!news.er.usgs.gov!jobone!news2.acs.oakland.edu!news.tacom.army.mil!news.webspan.net!www.nntp.primenet.com!nntp.primenet.com!cpk-news-hub1.bbnplanet.com!cam-news-hub1.bbnplanet.com!news.bbnplanet.com!news-xfer.netaxs.com!news-out.microserve.net!news-in.microserve.net!news.paonline.com!news3.paonline.com!user38.trellis.net
Xref: glinda.oz.cs.cmu.edu comp.lang.lisp:25299 sci.crypt:61942 comp.lang.c:236390

After you do the DUP NEGATE OR, instead of comparing the number with a
series of numbers like 11111000 in a table, you can instead MOD it by a
number slightly larger than the word size, and look up the log. Make
sure that all the possible results of DUP NEGATE OR are different after
n MOD. If you want the bit itself, not its index, of course, you simply
NEGATE.

If you want the highest 1 bit (I wasn't clear which one you wanted), you
do this:
		\ 0010010111000011
DUP 1 RSHIFT OR \ 0011011111100011
DUP 2 RSHIFT OR \ 0011111111111011
DUP 4 RSHIFT OR \ 0011111111111111
DUP 8 RSHIFT OR \ 0011111111111111
and proceed as before.

phma
