Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.lang.c Subject: Re: which bits are set Message-ID: <15598:Dec1804:57:0390@kramden.acf.nyu.edu> Date: 18 Dec 90 04:57:03 GMT References: <1990Dec12.205114.2376@uvm.edu> <3047:Dec1618:51:1590@kramden.acf.nyu.edu> <1990Dec17.071404.6544@kithrup.COM> Organization: IR Lines: 18 In article <1990Dec17.071404.6544@kithrup.COM> sef@kithrup.COM (Sean Eric Fagan) writes: > In article <3047:Dec1618:51:1590@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes: > >The brute force (i.e., fast) approach is to use a big table. > Eek. Why do that? For speed. The exact answer depends on how you want to store the sets. If you take my half-facetious suggestion of storing the sets as integers, it takes 0 operations. > The only way I can think of to do it faster than the > presented method is to get rid of the shift and loop: [ ... ] > Takes 32 sequential statements; on some machines, it will take 32 > instructions, while on others, it might take 64. Eek. Why do you want to make this so slow? ---Dan