NPTL/arc: notify kernel of the TP value
[uClibc.git] / test / math / rint.c
blobb595459a37496424da7d9da0a23021d1ca886793
1 #include <math.h>
2 #include <float.h>
3 #include <stdlib.h>
4 #include <stdint.h>
5 #include <stdio.h>
7 #define check_d1(func, param, expected) \
8 do { \
9 int err; hex_union ur; hex_union up; \
10 double result = func(param); up.f = param; ur.f = result; \
11 errors += (err = (result != (expected))); \
12 err \
13 ? printf("FAIL: %s(%g/"HEXFMT")=%g/"HEXFMT" (expected %g)\n", \
14 #func, (double)(param), (long long)up.hex, result, (long long)ur.hex, (double)(expected)) \
15 : printf("PASS: %s(%g)=%g\n", #func, (double)(param), result); \
16 } while (0)
18 #define HEXFMT "%08llx"
19 typedef union {
20 double f;
21 uint64_t hex;
22 } hex_union;
23 double result;
25 int errors = 0;
27 int main(void)
29 check_d1(rint, 0.6, 1.0);
31 printf("Errors: %d\n", errors);
32 return errors;