home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / programm / 2049 < prev    next >
Encoding:
Text File  |  1992-07-22  |  564 b   |  17 lines

  1. Newsgroups: comp.programming
  2. Path: sparky!uunet!microsoft!hexnut!gideony
  3. From: gideony@microsoft.com (Gideon Yuval)
  4. Subject: Re: finding 1st one in integer
  5. Message-ID: <1992Jul22.065111.16800@microsoft.com>
  6. Date: 22 Jul 92 06:51:11 GMT
  7. Organization: Microsoft Corporation
  8. References: <Brqu3F.1J4@undergrad.math.waterloo.edu> <1992Jul21.173805.12045@bcrka451.bnr.ca>
  9. Lines: 6
  10.  
  11. A 37-entry table suffices.
  12.  
  13. table[ ( (X xor (X-1)) modulo 37 ] will get you the 1st 1-bit
  14. from the bottom.
  15. -- 
  16. Gideon Yuval, gideony@microsoft.com, 206-882-8080 (fax:-883-8101;TWX:160520)
  17.