From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p4UBiEfq005754 for ; Mon, 30 May 2011 13:44:14 +0200 X-IronPort-AV: E=Sophos;i="4.65,290,1304287200"; d="scan'208";a="109849686" Received: from lri4-139.lri.fr (HELO [129.175.4.139]) ([129.175.4.139]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 30 May 2011 13:44:09 +0200 Message-ID: <4DE383FA.9010505@lri.fr> Date: Mon, 30 May 2011 13:48:10 +0200 From: =?ISO-8859-1?Q?Jean-Christophe_Filli=E2tre?= User-Agent: Thunderbird 2.0.0.24 (X11/20100411) MIME-Version: 1.0 To: Matteo Frigo CC: Xavier Leroy , caml-list@inria.fr References: <707567.2845.qm@web111505.mail.gq1.yahoo.com> <833816.58675.qm@web111502.mail.gq1.yahoo.com> <4DDFDC1F.5050605@inria.fr> <87y61qvhmo.fsf@fftw.org> In-Reply-To: <87y61qvhmo.fsf@fftw.org> X-Enigmail-Version: 0.96.0 OpenPGP: url=http://www.lri.fr/~filliatr/mykey.asc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] Re: Binary logarithm of a power of 2 > Knuth Vol. 4A remarks that this is an old trick, invented but not > published by some gentleman at IBM in the late sixties. (Sorry, I don't > have Knuth at hand for an exact reference.) However the 1998 paper by > Leiserson et al. should be available via google. Another good reference along these lines: Henry Warren's "Hacker's Delight" (http://www.hackersdelight.org/). My apologies if already mentioned in this thread. This book is wonderful and contains many ways to compute the number of trailing zeros, among other things. (It is cited in volume 4A.) -- Jean-Christophe