which bits are set

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Tue Dec 18 15:57:03 AEST 1990


In article <1990Dec17.071404.6544 at kithrup.COM> sef at kithrup.COM (Sean Eric Fagan) writes:
> In article <3047:Dec1618:51:1590 at kramden.acf.nyu.edu> brnstnd at 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



More information about the Comp.lang.c mailing list