From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA07609 for caml-redistribution@pauillac.inria.fr; Wed, 22 Mar 2000 19:21:54 +0100 (MET) Resent-Message-Id: <200003221821.TAA07609@pauillac.inria.fr> Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA20493 for ; Wed, 22 Mar 2000 18:05:12 +0100 (MET) Received: from csla.csl.sri.com (csla.csl.sri.com [192.12.33.2]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id SAA21088 for ; Wed, 22 Mar 2000 18:05:07 +0100 (MET) Received: from cylinder.csl.sri.com (IDENT:filliatr@cylinder.csl.sri.com [130.107.15.112]) by csla.csl.sri.com (8.9.1/8.9.1) with ESMTP id JAA10847; Wed, 22 Mar 2000 09:05:02 -0800 (PST) Received: (from filliatr@localhost) by cylinder.csl.sri.com (8.9.3/8.8.7) id JAA28227; Wed, 22 Mar 2000 09:05:01 -0800 X-Authentication-Warning: cylinder.csl.sri.com: filliatr set sender to filliatr@cylinder.csl.sri.com using -f From: Jean-Christophe Filliatre MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14552.64829.556329.741989@cylinder.csl.sri.com> Date: Wed, 22 Mar 2000 09:05:01 -0800 (PST) To: John Max Skaller Cc: caml-list@inria.fr Subject: Re: Unsigned integers? In-Reply-To: <38D7F617.1A8386D5@maxtal.com.au> References: <20000315145830.22463@pauillac.inria.fr> <20000316115540L.garrigue@kurims.kyoto-u.ac.jp> <38D7F617.1A8386D5@maxtal.com.au> X-Mailer: VM 6.62 under Emacs 20.4.1 Reply-To: filliatr@csl.sri.com (Jean-Christophe Filliatre) Resent-From: weis@pauillac.inria.fr Resent-Date: Wed, 22 Mar 2000 19:21:54 +0100 Resent-To: caml-redistribution@pauillac.inria.fr In his message of Wed March 22, 2000, John Max Skaller writes: > > Unfortunately, caml integers are signed, which makes most of the > code I have written wrong (I haven't taken the care to handle > integers over 2^30 correctly). > > What is the best way to handle this problem? > Would a (standard?) library module (written in C), that treats > integers as unsigned be a reasonable solution? I wrote such a C library to handle (boxed) 32 or 64 bits integers (you can find it on my web page). But it appeared that it was not very efficient, and when I rewrote my program using an encoding with two Caml integers, it was really faster. So I would suggest you to write such a library in Caml. For a good starting point, you may have a look at the module Nativeint in ocaml sources (in utils/nativeint.ml). Best regards, -- Jean-Christophe Filliatre Computer Science Laboratory Phone (650) 859-5173 SRI International FAX (650) 859-2844 333 Ravenswood Ave. email filliatr@csl.sri.com Menlo Park, CA 94025, USA web http://www.csl.sri.com/~filliatr