Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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,

Let's get rid of those possible thingies!  -- TB

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: