Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Jean-Christophe Filliatre <filliatr@lri.fr>
To: Hugues CASSE <casse@irit.fr>
Cc: CAML <caml-list@inria.fr>
Subject: Re: Logical operators...
Date: Fri, 27 Aug 1999 11:07:53 +0200 (MEST)	[thread overview]
Message-ID: <14278.21865.527274.77945@pc89.lri.fr> (raw)
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




  parent reply	other threads:[~1999-08-28 17:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-26 12:11 Hugues CASSE
1999-08-26 23:18 ` John Prevost
1999-08-27  9:07 ` Jean-Christophe Filliatre [this message]
1999-08-27  9:49 ` Reinhard Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14278.21865.527274.77945@pc89.lri.fr \
    --to=filliatr@lri.fr \
    --cc=Jean-Christophe.Filliatre@lri.fr \
    --cc=caml-list@inria.fr \
    --cc=casse@irit.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox