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 TAA14879; Mon, 26 Jul 2004 19:25:52 +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 TAA15235 for ; Mon, 26 Jul 2004 19:25:52 +0200 (MET DST) Received: from mwinf0802.wanadoo.fr (smtp8.wanadoo.fr [193.252.22.23]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i6QHPpSH029057 for ; Mon, 26 Jul 2004 19:25:51 +0200 Received: from Galois (Mix-Strasbourg-209-1-144.w80-9.abo.wanadoo.fr [80.9.104.144]) by mwinf0802.wanadoo.fr (SMTP Server) with ESMTP id 9C18D18000A7 for ; Mon, 26 Jul 2004 19:25:46 +0200 (CEST) Received: from evariste by Galois with local (Exim 3.36 #1 (Debian)) id 1Bp94I-0004x7-00 for ; Mon, 26 Jul 2004 19:15:18 +0200 Date: Mon, 26 Jul 2004 19:15:18 +0200 From: =?iso-8859-1?Q?S=E9bastien?= Hinderer To: caml-list@inria.fr Subject: Re: [Caml-list] 32-bit unsigned integers Message-ID: <20040726171517.GA19032@galois> Mail-Followup-To: caml-list@inria.fr Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Miltered: at concorde with ID 41053E9F.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; ens-lyon:01 caml-list:01 modulus:01 constants:01 -bit:01 caml:01 caml:01 int:01 int:01 binary:02 exception:02 string:03 string:03 unsigned:03 unsigned:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi again, > Yes: it's called int32. Think about it: being "unsigned" or "signed" > is not a property of the representation (it will be 32 binary digits > in both cases), it's just that some operations (division, modulus and > comparisons) interpret those bits differently. Sorry, I was caught by the fact they are signed. However, I'm not sure it is so easy. Indeed, the representation and the range of represented integers has to be exactly the same than with the uint32_t type of C, to allow me to use some constants defined in C in Caml programs. Consider for instance the following definition in a .h C header file : #define UINT32_MAX (4294967295U) Now I'd like to define the same thing in Caml: # let uint32_max = Int32.of_string "4294967295";; Exception: Failure "int_of_string". How can I solve this problem ? Thanks, Sébastien. ------------------- 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