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] Does Caml have slow arithmetics ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-07-07 (13:22)
From: David Haguenauer <David.Haguenauer@i...>
Subject: Re: [Caml-list] Does Caml have slow arithmetics ?
On 2004-07-07 14:32:56 Wed, Diego Olivier Fernandez Pons wrote:
> > In principle yes, because int values are represented as tagged
> > (31bits) ints (with the LSB set to 1). So conversion is a shift
> > followed by an addition (or viceversa).
> Subsidiary question : why LSB instead of MSB ? I thought it would be
> simpler to let the computations silently overflow and correct when
> necessary the tag bit.

Xavier Leroy's report about the ZINC experiment gives a good

    4.2.1 Unallocated objects

    The only kind of unallocated (unboxed) objects is small
    integers. As the heap contains only 32-bit words, all pointers in
    the heap are 32-bit aligned, so their low-order bits are always
    00. Integers are therefore encoded with a 1 as low-order bit:


David Haguenauer

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