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 TAA03899 for caml-redistribution; Sat, 28 Aug 1999 19:28:09 +0200 (MET DST) 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 LAA14742 for ; Fri, 27 Aug 1999 11:08:24 +0200 (MET DST) Received: from lri.lri.fr (lri.lri.fr [129.175.15.1]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id LAA11112 for ; Fri, 27 Aug 1999 11:08:22 +0200 (MET DST) Received: from pc89.lri.fr (pc89.lri.fr [129.175.8.108]) by lri.lri.fr (8.9.1a/8.9.1) with ESMTP id LAA26549; Fri, 27 Aug 1999 11:07:54 +0200 (MET DST) Received: by pc89.lri.fr (8.8.7/feuille) id LAA11337 ; Fri, 27 Aug 1999 11:07:53 +0200 X-Authentication-Warning: pc89.lri.fr: filliatr set sender to filliatr@pc89.lri.fr using -f From: Jean-Christophe Filliatre MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14278.21865.527274.77945@pc89.lri.fr> Date: Fri, 27 Aug 1999 11:07:53 +0200 (MEST) To: Hugues CASSE Cc: CAML Subject: Re: Logical operators... In-Reply-To: <37C52EEB.AE4@irit.fr> References: <37C52EEB.AE4@irit.fr> X-Mailer: VM 6.49 under Emacs 20.3.1 Reply-To: Jean-Christophe.Filliatre@lri.fr (Jean-Christophe Filliatre) Content-Transfer-Encoding: 7bit Sender: weis On a 32 bits architecture, ocaml' integers are signed 31 bits (one bit is reserved for the GC). Therefore : ====================================================================== # 0xffff0000;; - : int = -65536 ====================================================================== and that answers your question. If you really need 32 bits integers, I've written a small 32 bits integers library, which you can find here : http://www.lri.fr/~filliatr/ftp/ocaml/int32/ You can use it freely, and even adapt it to unsigned integers if necessary. Of course, there is a lack of performance compared to ocaml integers. Best regards, -- Jean-Christophe FILLIATRE mailto:Jean-Christophe.Filliatre@lri.fr http://www.lri.fr/~filliatr In his message of Thu August 26, 1999, Hugues CASSE writes: > Is there a bug or is there a way to get the correct result... > > # 0xffff0000 lsr 16;; > - : int = 32767 > while > # 0x0000ffff;; > - : int = 65535