1
/* Test of atan() function.
2
$Id: atan-01.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. */
17
union lofl_u x; /* argument */
18
union lofl_u z; /* atan(x) */
22
{ { .fl= +0.0 }, { .fl= +0.0 } },
23
{ { .fl= -0.0 }, { .fl= -0.0 } },
26
{ { 0x00000001 }, { 0x00000001 } },
27
{ { 0x00000100 }, { 0x00000100 } },
28
{ { 0x00010000 }, { 0x00010000 } },
29
{ { 0x007fffff }, { 0x007fffff } },
30
{ { 0x80000001 }, { 0x80000001 } },
31
{ { 0x80000100 }, { 0x80000100 } },
32
{ { 0x80010000 }, { 0x80010000 } },
33
{ { 0x807fffff }, { 0x807fffff } },
36
{ { 0x7f800000 }, { 0x3fc90fdb } }, /* +Pi/2 */
37
{ { 0xff800000 }, { 0xbfc90fdb } }, /* -Pi/2 */
40
{ { .fl= 0x0.ffffffp0 }, { 0x3f490fda } }, /* Pi/4 */
41
{ { .fl= 1.0 }, { 0x3f490fdb } }, /* Pi/4 */
42
{ { .fl= 0x1.000002p0 }, { 0x3f490fdc } }, /* Pi/4 */
44
{ { .fl= -0x0.ffffffp0 }, { 0xbf490fda } }, /* -Pi/4 */
45
{ { .fl= -1.0 }, { 0xbf490fdb } }, /* -Pi/4 */
46
{ { .fl= -0x1.000002p0 }, { 0xbf490fdc } }, /* -Pi/4 */
49
void x_exit (int index)
52
fprintf (stderr, "t[%d]: %#lx\n", index - 1, v.lo);
54
exit (index ? index : -1);
62
for (i = 0; i < (int) (sizeof(t) / sizeof(t[0])); i++) {
63
x.lo = pgm_read_dword (& t[i].x);
64
z.lo = pgm_read_dword (& t[i].z);
66
/* Comparison is integer to verify the zero sign. */