Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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.

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