Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!zephyr.ens.tek.com!uw-beaver!cornell!hilfingr From: hilfingr@rama.cs.cornell.edu (Paul N. Hilfinger) Newsgroups: comp.lang.c Subject: Re: which bits are set Message-ID: <49858@cornell.UUCP> Date: 18 Dec 90 18:37:52 GMT References: <3047:Dec1618:51:1590@kramden.acf.nyu.edu> <1990Dec17.071404.6544@kithrup.COM> <15598:Dec1804:57:0390@kramden.acf.nyu.edu> <1990Dec18.093905.17196@kithrup.COM> Sender: nobody@cornell.UUCP Reply-To: hilfingr@cs.cornell.edu (Paul N. Hilfinger) Organization: Cornell Univ. CS Dept, Ithaca NY Lines: 28 In article <1990Dec18.093905.17196@kithrup.COM> sef@kithrup.COM (Sean Eric Fagan) writes: >Well, let's see. The problem was to convert something like > > 0x12345678 > >into something like > > bit_set[0] = 0; > bit_set[1] = 0; > bit_set[2] = 0; > bit_set[3] = 1; Well, no it wasn't. The original problem was to convert 0x12345678 into something like bit_set[0] = 3; bit_set[1] = 4; bit_set[2] = 5; bit_set[3] = 6; bit_set[4] = 9; ... bit_set[15] = -1; /* Excuse me if my counting is off. */ for which I suspect Mr. Bernstein's proposed solution sketch is probably pretty good. P. Hilfinger