1 #define _DEFAULT_SOURCE 1
7 static struct ff_f t
[] = {
8 #include "sanity/scalbf.h"
9 #include "special/scalbf.h"
15 #pragma STDC FENV_ACCESS ON
21 for (i
= 0; i
< sizeof t
/sizeof *t
; i
++) {
27 feclearexcept(FE_ALL_EXCEPT
);
28 y
= scalbf(p
->x
, p
->x2
);
29 e
= fetestexcept(INEXACT
|INVALID
|DIVBYZERO
|UNDERFLOW
|OVERFLOW
);
31 if (!checkexceptall(e
, p
->e
, p
->r
)) {
32 printf("%s:%d: bad fp exception: %s scalbf(%a,%a)=%a, want %s",
33 p
->file
, p
->line
, rstr(p
->r
), p
->x
, p
->x2
, p
->y
, estr(p
->e
));
34 printf(" got %s\n", estr(e
));
37 d
= ulperrf(y
, p
->y
, p
->dy
);
38 if (!checkcr(y
, p
->y
, p
->r
)) {
39 printf("%s:%d: %s scalbf(%a,%a) want %a got %a ulperr %.3f = %a + %a\n",
40 p
->file
, p
->line
, rstr(p
->r
), p
->x
, p
->x2
, p
->y
, y
, d
, d
-p
->dy
, p
->dy
);