Mail Archives: djgpp-workers/2003/04/22/09:23:43
Hello.
Eli Zaretskii wrote:
>
> > From: <ams AT ludd DOT luth DOT se>
> > Date: Thu, 17 Apr 2003 19:03:00 +0200 (CEST)
> >
> > My readings on the net doesn't show what a long double with it
> > exponent set to 0x7fff and a _cleared_ most significant bit in the
> > mantissa is. The most significant bit for a long double is the
> > integer bit (which isn't present in floats or doubles).
> >
> > As far as I understand a long double with exponent == 0 and with
> > the most significant bit in the mantissa cleared is a denormal (which
> > isn't a NaN but a value close to 0).
> >
> > But I don't know what to make of it when exponent != 0.
> >
> > Are they all NaNs? Only the ones with exponent == 0x7fff? Or none of
> > them?
>
> See section 7.4.4 of the Intel Manual: it calls those numbers
> "unnormals".
>
> Such numbers are generally a result of interpreting arbitrary bit
> patterns as FP numbers (a.k.a. "bugs").
>
> IIRC, our _doprnt has special support for those.
Yes, it does. From isspeciall:
/* Unnormals: the MSB of mantissa is non-zero, but the exponent is
not zero either. */
if ((ip->manh & 0x80000000U) == 0 && ip->exp != 0)
{
if (ip->sign)
*bufp++ = '-';
strcpy(bufp, UNNORMAL_REP);
return strlen(bufp) + ip->sign;
}
ip is a long double cast into the IEEE split-format struct: (high mantissa,
low mantissa, exponent, sign). UNNORMAL_REP is "Unnormal".
Bye, Rich =]
--
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]
- Raw text -