Hi Stef,
On Feb 1, 2016, at 11:03 PM, stepharo <stepharo@free.fr> wrote:
What about something like that
My instances hold 64-bit Floats in heap objects. This is the only representation on 32-bit systems. But on 64-bit systems SmallFloat64 holds a subset of the full 64-bit double-precision range in immediate objects.
BoxedFloat64 is the classical VM Float, two 4-bytes word allocated per Float, and is both for 32 bits VM and Float values not fitting in immediate format. This is because 3 bits have been removed from the exponent due to the object internal representation needed for the Spur new garbage collector.
So on a 32 bits VM Floats are represented either by BoxedFloat64 or Float.
No. Float is now an abstract class. There are only instances of BoxedFloat64 or SmallFloat64. And in 32-bits there are only BoxedFloat64 instances. So on a 32 bits VM Floats are represented only by BoxedFloat64. On a 64 bits VM Floats are represented either by BoxedFloat64 or SmallFloat64.