English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] More or bignums/ints
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-06-14 (16:17)
From: Andreas Rossberg <rossberg@p...>
Subject: Re: [Caml-list] More or bignums/ints
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.


	- 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