Re: Logical operators...

From: Reinhard Budde (reinhard.budde@gmd.de)
Date: Fri Aug 27 1999 - 11:49:48 MET DST


Message-Id: <37C65F3C.DA023DA8@gmd.de>
Date: Fri, 27 Aug 1999 11:49:48 +0200
From: Reinhard Budde <reinhard.budde@gmd.de>
To: CAML <caml-list@inria.fr>
Subject: Re: Logical operators...

Hugues CASSE wrote:
> Is there a bug or is there a way to get the correct result...
> # 0xffff0000 lsr 16;;
> - : int = 32767
> while
> # 0x0000ffff;;
> - : int = 65535
ints are represented with 31 bits. This is sometimes suprising:

        Objective Caml version 2.01
# 0xffff0000;;
- : int = -65536
# 0x7fff0000;;
- : int = -65536

Consequently:
# 0xffff0000 = 0x7fff0000;;
- : bool = true

0xffff0000 ist not represented in ocaml as you expected

Reinhard
--------------
Reinhard Budde reinhard.budde@gmd.de
GMD - German National Research Center for Information
Technology
AiS - Autonomous intelligent Systems
D-53754 St.Augustin tel: +2241-14-2417,fax: +2241-14-2324



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