1
/* Test of log() function.
2
$Id: log-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: x, log(x) */
21
{ { 0x00000000 }, { 0xff800000 } },
22
{ { 0x80000000 }, { 0xff800000 } }, /* -0.0 is legal arg. */
25
{ { 0x7f800000 }, { 0x7f800000 } },
27
{ { .fl = 1 / 2.7182818 }, { .fl = -1 } },
28
{ { .fl = 1 }, { .fl = 0 } },
29
// { { .fl = 2.7182819 }, { .fl = 1 } },
32
void x_exit (int index)
35
fprintf (stderr, "t[%d]: %#lx\n", index - 1, v.lo);
37
exit (index ? index : -1);
45
for (i = 0; i < (int) (sizeof(t) / sizeof(t[0])); i++) {
46
x.lo = pgm_read_dword (& t[i].x);
47
z.lo = pgm_read_dword (& t[i].z);
49
/* Comparison is integer to verify the zero sign. */