[Vm-dev] Re: [squeak-dev] Float hierarchy for 64-bit Spur
J. Vuletich (mail lists)
juanlists at jvuletich.org
Fri Nov 21 12:58:51 UTC 2014
Quoting Bert Freudenberg <bert at freudenbergs.de>:
> On 21.11.2014, at 13:29, J. Vuletich (mail lists)
> <juanlists at jvuletich.org> wrote:
>> Quoting Bert Freudenberg <bert at freudenbergs.de>:
>>> I'd suggest BoxedDouble and ImmediateDouble as names for the
>>> concrete subclasses (*). Names do mean something. (**)
>>> You're right about the FloatArray confusion. However, note that
>>> the IEEE standard calls it single and double. It's only C using
>>> "float" to mean "single precision".
>>> I'd name the abstract superclass Float, for readability, and the
>>> isFloat test etc. Also: "Float pi" reads a lot nicer than anything
>>> else. I don't see the need for having a deep LimitedPrecisionReal
>>> - Float - BoxedDouble/ImmediateDouble deep hierarchy now.
>>> If we ever add single-precision floats, we should name them
>>> BoxedSingle and ImmediateSingle. At that point we might want a
>>> Single superclass and a LimitedPrecisionReal supersuperclass, but
>>> we can cross that bridge when we get there.
>>> - Bert -
>>> (*) Since we're not going to see the class names often, we could
>>> even spell it out as BoxedDoublePrecisionFloat and
>>> ImmediateDoublePrecisionFloat. Only half joking. It would make the
>>> relation to the abstract Float very clear.
>>> (**) We could also try to make the names googleable. I was
>>> surprised to not get a good hit for "boxed immediate". Only "boxed
>>> unboxed" finds it. Maybe there are two better words?
>> I very much agree with Bert. But I'd suggest SmallDouble instead of
>> ImmediateDouble for consistency with SmallInteger.
> Then it would have to be LargeDouble for consistency with
> LargeInteger, too. Which I don't find compelling.
Please no. 'Large' in LargeInteger means unlimited or at least
extended range. These won't be 'extended' doubles (like, for example,
C 'long double'). They would be plain standard ieee Double. A
LargeDouble could perhaps be an arbitrary precision Double or such,
> Also, with the 64 bit format we get many more immediate objects.
> There already are immediate integers and characters, floats will be
> the third, there could be more, like immediate points. For those,
> the small/large distinction does not make sense.
That's a point, sure. But the parallels between SmallInteger and
SmallDouble should be explicit.
> Maybe Eliot's idea of keeping "Float" in the name was best, but
> instead of "small" use "immediate":
> Float - BoxedFloat - ImmediateFloat
> A Float is either a BoxedFloat or an ImmediateFloat, depending on
> the magnitude of its exponent.
> - Bert -
Again, please no. Float means 32 bit single precision for too many
people out there. It means that in our own FloatArrays. Doubles are
To me the best option is SmallDouble and BoxedDouble or simply Double.
More information about the Vm-dev