1
/* Test of ldexp function. NaNs.
2
$Id: ldexp-nan.c,v 1.1 2007/02/05 21:35:58 dmix Exp $
14
volatile union lofl_u v = { .lo = 1 };
16
PROGMEM const struct { /* Table of test cases. */
21
{ { 0x7f800001 }, 1 },
22
{ { 0x7f800100 }, 1 },
23
{ { 0x7f810000 }, 1 },
24
{ { 0x7fffffff }, 1 },
25
{ { 0xff800001 }, 1 },
26
{ { 0xff800100 }, 1 },
27
{ { 0xff810000 }, 1 },
28
{ { 0xffffffff }, 1 },
30
{ { 0x7fc00000 }, 0 },
31
{ { 0xffc00000 }, 0 },
33
{ { 0x7fc00000 }, 32767 },
34
{ { 0x7fc00000 }, -32768 },
37
void x_exit (int index)
40
fprintf (stderr, "t[%d]: %e (%#lx)\n", index - 1, v.fl, v.lo);
42
exit (index ? index : -1);
51
for (i = 0; i < (int) (sizeof(t) / sizeof(t[0])); i++) {
52
x.lo = pgm_read_dword (& t[i].x);
53
y = pgm_read_word (& t[i].y);
54
v.fl = ldexp (x.fl, y);