Mail Archives: djgpp-workers/1999/01/19/08:34:56
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 <stdio.h>
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;
}
- Raw text -