From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id GAA07779; Wed, 12 May 2004 06:19:16 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id GAA09661 for ; Wed, 12 May 2004 06:19:14 +0200 (MET DST) Received: from calmail-cr.berkeley.edu (mailfarm.Berkeley.EDU [128.32.61.106]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i4C4JCSH028404 for ; Wed, 12 May 2004 06:19:13 +0200 Received: from [169.229.108.172] (HELO phirelord) by calmail-cr.berkeley.edu (CommuniGate Pro SMTP 4.1.8) with SMTP id 26867972; Tue, 11 May 2004 21:19:12 -0700 Date: Tue, 11 May 2004 21:19:12 -0700 From: Michael Hoisie Cc: yminsky@gmail.com, Caml Mailing List Subject: Re: [Caml-list] Counting bits in a big_int Message-Id: <20040511211912.01ed66a0@phirelord> In-Reply-To: <891bd3390405112022194630a8@mail.gmail.com> References: <891bd3390405112022194630a8@mail.gmail.com> Organization: UC Berkeley X-Mailer: Sylpheed version 0.9.10claws (GTK+ 1.2.10; i386-portbld-freebsd4.10) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 40A1A5C1.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 int:01 int:01 arbitrary:02 mean:05 bits:05 bits:05 100.:93 michael:08 equal:09 100:89 what:21 edu:22 where:22 then:23 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk If you have any arbitrary big_int, n, wouldn't the number of bits be equal to 2^x, where x is the number such that 2^x >= n? So, if you have 100 (1100100), then the number of bits would be 7, because 2^7>=100. Is this what you mean? -Michael Hoisie ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners