Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Xavier Leroy <xleroy@pauillac.inria.fr>
To: Max Skaller <maxs@in.ot.com.au>
Cc: caml-list@pauillac.inria.fr
Subject: Re: what does "32-bit integer" mean?
Date: Thu, 27 Apr 2000 10:17:49 +0200	[thread overview]
Message-ID: <20000427101749.40550@pauillac.inria.fr> (raw)
In-Reply-To: <39069410.FC5F5DBB@in.ot.com.au>; from Max Skaller on Wed, Apr 26, 2000 at 05:00:32PM +1000

> 	A comment on the documentation for the integer types.
> What does '32 bit integer' mean?

It means "an integer whose machine representation consists of 32
binary digits".  How surprising...

> What is the meaning of 'bitwise or'?

It means "the logical `or' operation applied bit per bit to the
machine representations of its two arguments".  Unexpected, isn't it?

(I think you just won the first prize for most vacuous question asked on
this mailing list.)

> It is _necessary_ to say something like
> 	'implements an integer with 32 bit twos complement
> representation' for either of these statements to be meaningful,
> that is, to establish a mapping between an array of 32 bits,
> and an integral value. 

Ah, twos complement and ones complement -- comp.lang.c 's favorite
flame war.  (I know you love flame wars, but are you sure we should
have this one here?) 

Caml integers are C integers in (slight) disguise -- by virtue of the
Caml bytecode interpreter being written in ANSI C.  C integers are
machine integers in (slight) disguise.  The ANSI C reference explains
what can be assumed on integers and what is machine-dependent.  Yes,
bitwise operations expose the difference between twos complement and
ones complement.  So what?

At any rate, no ones complement computer have been produced in the last
20 years, so it should be safe to assume twos complement if you need
to make that assumption.

This reminds me of a nice compiler book from the late 60s, whose title
is something like "Compilation for digital computers".  Presumably, in
these days, one had to specify that one's computer was digital, not
analog.  Now we don't bother.

- Xavier Leroy




  reply	other threads:[~2000-04-27 13:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-25 13:26 Objective Caml 3.00 released Xavier Leroy
2000-04-25 19:08 ` John Prevost
2000-04-26  7:00 ` Max Skaller
2000-04-27  8:17   ` Xavier Leroy [this message]
2000-04-27 15:41     ` what does "32-bit integer" mean? Paul A. Steckler
2000-04-28  2:07     ` John Max Skaller
2000-04-28  8:35       ` Xavier Leroy
2000-04-28 23:24         ` John Max Skaller
2000-04-26  9:55 ` Objective Caml 3.00 released Andreas Rossberg
2000-04-26 20:02 ` LablTk in Objective Caml 3.00 T. Kurt Bond
2000-04-28  0:22   ` Jacques Garrigue
2000-04-28  2:12     ` T. Kurt Bond
2000-04-26 21:35 ` Help: anyone knows what this error message means Friedman Roy
2000-04-27 13:39   ` Frank Atanassow
2000-04-27 17:01 ` Objective Caml 3.00 released Julian Assange

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=20000427101749.40550@pauillac.inria.fr \
    --to=xleroy@pauillac.inria.fr \
    --cc=caml-list@pauillac.inria.fr \
    --cc=maxs@in.ot.com.au \
    /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