Re: Logical operators...

From: Jean-Christophe Filliatre (filliatr@lri.fr)
Date: Fri Aug 27 1999 - 11:07:53 MET DST


From: Jean-Christophe Filliatre <filliatr@lri.fr>
Date: Fri, 27 Aug 1999 11:07:53 +0200 (MEST)
To: Hugues CASSE <casse@irit.fr>
Subject: Re: Logical operators...
In-Reply-To: <37C52EEB.AE4@irit.fr>

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



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:24 MET