Browse thread
Logical operators...
-
Hugues CASSE
- John Prevost
- Jean-Christophe Filliatre
- Reinhard Budde
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Jean-Christophe Filliatre <filliatr@l...> |
| Subject: | Re: Logical operators... |
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