| /* Test corner case for IEEE expm1 |
| * http://pubs.opengroup.org/onlinepubs/9699919799/functions/expm1.html |
| #ifndef __USE_MINGW_ANSI_STDIO |
| #define __USE_MINGW_ANSI_STDIO 1 |
| #define STR_VALUE(arg) #arg |
| #define TEST(func, dtype, fmt) do { \ |
| dtype input, output, exp; \ |
| dtype inp_out[N_TESTS][2] = { \ |
| {MINUS_ZERO, MINUS_ZERO}, \ |
| sprintf(fmt_str, "%s(%s) = %s\n", STR_VALUE(func), fmt, fmt); \ |
| for (i=0; i<N_TESTS; i++) { \ |
| printf(fmt_str, input, output); \ |
| if ((output != exp && !isnan(exp)) \ |
| || (isnan(output) ^ isnan(exp))) \ |
| printf("which is bogus!\n"); \ |
| TEST (expm1, double, "%f"); |
| TEST (expm1f, float, "%f"); |
| TEST (expm1l, long double, "%lf"); |