Date: Tue, 19 Jan 1999 08:33:58 -0500 (EST) From: Stephen L Moshier X-Sender: moshier AT moshier DOT ne DOT mediaone DOT net To: Eli Zaretskii cc: Robert Hoehne , djgpp-workers AT delorie DOT com, "K.B. Williams" Subject: Re: Bug when printing long doubles In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com I'm pretty sure the Intel coprocessor manual will say that is an invalid bit pattern, because the most significant bit of the significand is not set while the exponent is something other than 0 or 7fff. Try adding zero to it, as in the following. The coprocessor should turn it into a NaN pattern. #include unsigned char i[10] = { 0x13, 0x22, 0xf7, 0xfc, 0x2f, 0x3e, 0x28, 0x6f, 0x3a, 0xa3}; int main () { char buf[100]; union { unsigned char c[12]; long double dd; } u; long double dd2; int k; for (k = 0; k < 10; k++) u.c[k] = i[k]; dd2 = u.dd + 0.0; sprintf (buf, "%*.17LG", 16, dd2); fprintf (stderr, "%s\n", buf); return 0; }