[squeak-dev] Re: [Pharo-dev] Float class comment

Marcus Denker marcus.denker at inria.fr
Thu Nov 27 08:15:48 UTC 2014


I added an issue tracker entry

	14536	Float class comment
		https://pharo.fogbugz.com/f/cases/14536


> On 25 Nov 2014, at 18:42, Eliot Miranda <eliot.miranda at gmail.com> wrote:
> 
> 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



More information about the Squeak-dev mailing list