Mail Archives: djgpp-workers/2000/03/15/10:44:34
On Wed, 15 Mar 2000, Hans-Bernhard Broeker wrote:
> > Perhaps, it would be preferable, to print "nan(unnormal)" for the
> > unnormal case, to be std conform.
>
> *If* an unnormal is a NaN, yes.
How can one tell? If the standard doesn't define what is a NaN (as I
think it doesn't), then the answer is platform-dependent, and we are
back to the Intel manuals which define this.
> The question still hovering in my head
> would then be what the difference is between a subnormal (supposed to be
> detectable by C99 functions) and an unnormal (mentioned nowhere in the
> whole draft). I remember having discussed this before, on this list, but
> not the details...
Let me remind you. Unnormal (a name I picked up from Robert Hummel's
superb "The Processor and Coprocessor" book) is a denormal with a biased
exponent greater than zero. In other words, it's a long double number
whose mantissa's MSB is zero, but whose unbiased exponent is greater than
the minimum supported exponent.
> Subnormals as defined by C99 are fp numbers with smallest possible
> exponent, and a mantissa smaller than 0.5 (i.e. no leading one-bit). These
> can only happen for 'long double', indeed, as the other formats use a
> hidden leading one-bit for the mantissa.
Likewise for the unnormal: it can only happen for a long double.
- Raw text -