Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: Fw: Overflow and Inf



> Date: Wed, 29 Sep 2010 14:55:14 -0400
> To: stds-1788                    <stds-1788@xxxxxxxxxxxxxxxxx>
> From: Michel Hack                          <hack@xxxxxxxxxxxxxx>
> Subject: Fw: Overflow and Inf
> 
> Ian McIntosh wrote:
> > With 754 Decimal Floating Point, the details are different
> > but most of the same issues apply.
> 
> Actually, NO!  The representation of Infinity is precisely one area
> where DFP has bits to spare.  In principle the format could support
> payloads for Inf just as it can for NaN -- because, unlike BFP, the
> Inf/Nan distinction is independent of the payload (as is the QNaN
> vs SNaN distinction, for that matter).
> 
> The current 754-2008 standard assumes a canonical Infinity, with a
> payload of zero, and all operations that generate Inf must generate
> the canonical one, so the bits cannot be exploited now -- but the
> room for functional expansion is there!
> 
> Michel.
> ---Sent: 2010-09-29 19:02:22 UTC

	Alas, this is false.

	An IEEE floating-point format is fully characterized by

	--- b = the radix, 2 or 10
	--- p = the number of digits in the significand (precision)
	--- emax = the maximum exponent e
	--- emin = the minimum exponent e
	    emin shall be 1 - emax for all formats.

	I quote from IEEE Std 743-2008, section 3.3 Sets of floating-
	point data, page 8:

<begin quote>

Within each format, the following floating-point data shall be represented:

	--- Signed zero and non-zero floating-point numbers of the form
	    (-1)^s*b^e*m, where
		--- s is 0 or 1.
		--- e is any integer emin <= e <= emax.
		--- m is a number represented by a digit string of the form
		    d0.d1d2...d(p-1) where d(i) is an integer digit 0<=d(i)<b
		    (therefore 0<=m<b).
	--- Two infinities, +infinity and -infinity.
	--- Two NaNs, qNaN (quiet) and sNaN (signaling).

These are the only floating-point data represented.

<end quote>

	I point out that last sentance to you.

	The standard goes on to specify interchange format encodings
	for standard subsets of the parameters <b,p,emax>.  Binary
	(which use all the bit patterns) & decimal (which do not).
	Other choices of parameters for floating-point datatypes
	permit the implementation to decide their own encodings.

	Further, in what may be a bit confusing to the reader, the
	decimal formats encode for numbers like 3, 3.0, 3.00, &
	0.003e3 distinctly.  These are called cohorts, are part
	of the represented set of numbers defined above, & are of
	significance to the decimal people to figure out how many
	digits to print a number.

	Then as Michel points out, as a practical matter, there
	are decimal bit patterns which do not encode for anything
	within the set of represented floating-point data.
	
	This is of no significance.

	These bit patterns have no meaning.

	They are not available for any expansion of the set of
	represented floating-point values.

	That set cannot be expanded.

	Just FYI,

				Dan