[squeak-dev] Float class comment

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Wed Nov 26 23:01:33 UTC 2014


Float fminNormalized significand 1.0
Float fminNormalized exponent -1022

Float fminNormalized predecessor significand 1.9999999999999996
Float fminNormalized predecessor exponent -1023

But the significand only has 52 bits in this case of underflow.
Gradual underflow is removing the leading 1, so that one should better be
written like:
Float fminNormalized predecessor =
2r0.1111111111111111111111111111111111111111111111111111e-1022
and that means that the exponent is still -1022 for gradual underflow (aka
Float emin)...

And the smallest Float above zero is :
Float fmin significand 1.0
Float fmin exponent -1074
or
Float fmin = 2r0.0000000000000000000000000000000000000000000000000001e-1022

Nicolas

2014-11-25 18:42 GMT+01:00 Eliot Miranda <eliot.miranda at gmail.com>:

> Hi All,
>
>     who wrote the Float class comment?  Two things,
>
> - first the comment mentions "I" and thanks several people, but there is
> no comment stamp to reveal the author.  It would be lovely if the author
> could "sign" this comment
>
> - second, there seems to be a minor error (but I'm no expert), the comment
> states
>
> "It may help you to know that the basic format is...
> sign 1 bit
> exponent 11 bits with bias of 1023 (16r3FF) to produce an exponent
> in the range -1023 .. +1024
> - 16r000:
> significand = 0: Float zero
> significand ~= 0: Denormalized number (exp = -1024, no hidden '1' bit)
> - 16r7FF:
> significand = 0: Infinity
> significand ~= 0: Not A Number (NaN) representation
> mantissa 53 bits, but only 52 are stored (20 in the first word, 32 in the
> second).  This is because a normalized mantissa, by definition, has a 1 to
> the right of its floating point, and IEEE-754 omits this redundant bit to
> gain an extra bit of precision instead.  People talk about the mantissa
> without its leading one as the FRACTION, and with its leading 1 as the
> SIGNFICAND."
>
> But if the significand has a leading zero then surely the section in the
> middle should read
>
> sign 1 bit
> exponent 11 bits with bias of 1023 (16r3FF) to produce an exponent
> in the range -1023 .. +1024
> - 16r000:
> mantissa = 0: Float zero
> mantissa ~= 0: Denormalized number (exp = -1024, no hidden '1' bit)
> - 16r7FF:
> mantissa = 0: Infinity
> mantissa ~= 0: Not A Number (NaN) representation
>
> Right?
> --
> best,
> Eliot
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20141127/cc3c659f/attachment.htm


More information about the Squeak-dev mailing list