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 UAA17479; Mon, 26 Jul 2004 20:10:03 +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 UAA16812 for ; Mon, 26 Jul 2004 20:09:55 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from postfix3-2.free.fr (postfix3-2.free.fr [213.228.0.169]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i6QI9sSH002462 for ; Mon, 26 Jul 2004 20:09:54 +0200 Received: from localhost (gobelins-4-81-56-65-67.fbx.proxad.net [81.56.65.67]) by postfix3-2.free.fr (Postfix) with ESMTP id 9D61EC649; Mon, 26 Jul 2004 20:09:52 +0200 (CEST) Received: from boris by localhost with local (Exim 3.36 #1 (Debian)) id 1Bp9v6-0004Hc-00; Mon, 26 Jul 2004 20:09:52 +0200 Date: Mon, 26 Jul 2004 20:09:51 +0200 From: Boris Yakobowski To: "Corey O'Connor" Cc: caml-list@inria.fr Subject: Re: [Caml-list] 32-bit unsigned integers Message-ID: <20040726180951.GA16244@elrond> Reply-To: Boris Yakobowski Mail-Followup-To: Boris Yakobowski , Corey O'Connor , caml-list@inria.fr References: <20040726171517.GA19032@galois> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Operating-System: Linux elrond 2.6.7 User-Agent: Mutt/1.5.6+20040523i X-Miltered: at concorde with ID 410548F2.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; boris:01 yakobowski:01 yakobowski:01 caml-list:01 2004:99 corey:99 2004:99 ens-lyon:01 font:99 val:01 boris:01 -bit:01 ocaml:01 ocaml:01 caml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Mon, Jul 26, 2004 at 10:49:25AM -0700, Corey O'Connor wrote: > On Mon, 26 Jul 2004 19:15:18 +0200, Sébastien Hinderer > wrote: > > Now I'd like to define the same thing in Caml: > > > > # let uint32_max = Int32.of_string "4294967295";; > > Exception: Failure "int_of_string". > > Ah! I asked the same question just a bit ago! > > A "language extension" to Ocaml (Make sure you have 3.07.11 or > greater) is to directly assign 32 bit integers without using > Int32.of_string. Just add an "l" to the end of the constant. (Lower > case "L" if your font is strange and it looks like a 1 | I) It's like > so: > > # let blah = 0x8FFFFFFFl;; > val blah : int32 = -1879048193l > # Unfortunately, this is still not enough in Ocaml 3.08 for the unsigned integers needed by Sebastien: Objective Caml version 3.08 # 4294967295l;; Integer literal exceeds the range of representable integers of type int32 # -- Boris ------------------- 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