9 #define RN FE_TONEAREST
10 #define RZ FE_TOWARDZERO
11 #define RD FE_DOWNWARD
19 #define INEXACT FE_INEXACT
20 #define INVALID FE_INVALID
21 #define DIVBYZERO FE_DIVBYZERO
22 #define UNDERFLOW FE_UNDERFLOW
23 #define OVERFLOW FE_OVERFLOW
30 #define T(...) {__FILE__, __LINE__, __VA_ARGS__},
32 #define POS char *file; int line;
33 struct d_d {POS int r; double x; double y; float dy; int e; };
34 struct f_f {POS int r; float x; float y; float dy; int e; };
35 struct l_l {POS int r; long double x; long double y; float dy; int e; };
36 struct ff_f {POS int r; float x; float x2; float y; float dy; int e; };
37 struct dd_d {POS int r; double x; double x2; double y; float dy; int e; };
38 struct ll_l {POS int r; long double x; long double x2; long double y; float dy; int e; };
42 int rconv(int *, char *);
43 int econv(int *, char *);
47 int eulpl(long double);
49 float ulperr(double got, double want, float dwant);
50 float ulperrf(float got, float want, float dwant);
51 float ulperrl(long double got, long double want, float dwant);
56 static int checkexcept(int got, int want, int r)
59 return got == want || got == (want|INEXACT);
60 return 1; //(got|INEXACT|UNDERFLOW) == (want|INEXACT|UNDERFLOW);
63 static int checkulp(float d, int r)
66 return fabsf(d) <= 1.0;
67 return 1; //fabsf(d) <= 2.0;