From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p4S5U6gD018003 for ; Sat, 28 May 2011 07:30:06 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAESH4E3Vujhf/2dsb2JhbABVG6Ynd8V3hh4En2E X-IronPort-AV: E=Sophos;i="4.65,284,1304287200"; d="scan'208";a="100033963" Received: from witko.kerneis.info ([213.186.56.95]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/AES256-SHA; 28 May 2011 07:30:01 +0200 Received: from gabriel by witko.kerneis.info with local (Exim 4.72) (envelope-from ) id 1QQC63-000683-Rb; Sat, 28 May 2011 07:30:00 +0200 Date: Sat, 28 May 2011 07:29:59 +0200 From: Gabriel Kerneis To: Dario Teixeira Cc: caml-list@inria.fr, Sylvain Le Gall Message-ID: <20110528052959.GA5839@kerneis.info> References: <891579.63577.qm@web111515.mail.gq1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <891579.63577.qm@web111515.mail.gq1.yahoo.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: gabriel@kerneis.info X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on witko.kerneis.info X-Spam-Level: X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000) X-SA-Exim-Scanned: Yes (on witko.kerneis.info) Subject: Re: [Caml-list] Re: Binary logarithm of a power of 2 On Fri, May 27, 2011 at 10:21:09AM -0700, Dario Teixeira wrote: > Incidentally, I found a web page with lots of cool bit-twiddling hacks, > which includes several solutions to the binary logarithm problem: > http://graphics.stanford.edu/~seander/bithacks.html Some more of them: http://www.cl.cam.ac.uk/~am21/hakmemc.html Those are the (famous) HAKMEM tricks, translated to C by Alan Mycroft. Probably of no practical use, but learning what the fixed point of the float function was on a PDP-10 is priceless... Best, -- Gabriel