Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Need unsigned int
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Damien Doligez <damien.doligez@i...>
Subject: Re: [Caml-list] Need unsigned int
On Wednesday, January 22, 2003, at 03:55 PM, Nicolas Cannasse wrote:

> let ui_compare x y =
>     x lsr 16 < y lsr 16 || x land 0xFFFF < y land 0xFFFF

Watch out !  This definition is wrong.


> Is what you need.
>
> ui_compare 1 2;; // true
> ui_compare (-1) 2;; // false

ui_compare 65536 1;; // true


-- Damien

-------------------
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