From: Andreas Rossberg <rossberg@ps.uni-sb.de>
To: caml-list@inria.fr
Subject: Re: [Caml-list] More or bignums/ints
Date: Mon, 14 Jun 2004 18:17:40 +0200 [thread overview]
Message-ID: <40CDCFA4.7080806@ps.uni-sb.de> (raw)
In-Reply-To: <Pine.LNX.4.44.0406141019580.4243-100000@localhost.localdomain>
Brian Hurt wrote:
>
>>I was a little depressed
>>to find (by trial and error) that "int" doesn't mean "integer" but
>>rather "element of Z/nZ for some very large n, represented with
>>integer notation, including negative signs."
>
> Yep. Generally mod 2^n for some n. This is because this is what the
> hardware supplies for fast integer arithemetic. "Fixing" this, so that
> ints are real (mathematical) integers entails a *huge* performance cost,
> for very little gain.
I believe it is not too significant for most applications. And it could
easily be subject to the no-bound-checks compiler switch, to satisfy
performance junkies and number crunchers.
> How big of a performance hit, I don't know. I note that on the Great
> Language Shootout page, SML/NJ has a much lower performance score than
> Ocaml or MLton.
Note that MLton also implements overflow checks, because they are
required by the SML language/library specification.
Cheers,
- Andreas
--
Andreas Rossberg, rossberg@ps.uni-sb.de
Let's get rid of those possible thingies! -- TB
-------------------
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
next prev parent reply other threads:[~2004-06-14 16:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-11 19:38 John Hughes
2004-06-12 0:09 ` Jacques Garrigue
2004-06-14 15:37 ` Brian Hurt
2004-06-14 16:17 ` Andreas Rossberg [this message]
2004-06-14 15:55 ` Xavier Leroy
2004-06-15 22:45 ` Manos Renieris
2004-06-15 20:26 ` Brian Hurt
2004-06-15 20:36 ` Brian Hurt
2004-06-23 10:50 ` John Hughes
2004-06-23 14:51 ` skaller
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=40CDCFA4.7080806@ps.uni-sb.de \
--to=rossberg@ps.uni-sb.de \
--cc=caml-list@inria.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