1 /* Check that certain subnormal numbers (formerly known as denormalized
2 numbers) are rounded to within 0.5 ulp. PR other/14354. */
4 /* This test requires that float and unsigned int are the same size and
5 that the sign-bit of the float is at MSB of the unsigned int. */
7 #if __INT_MAX__ != 2147483647L
8 int main () { exit (0); }
36 tstmul (unsigned int ux
, unsigned int uy
, unsigned int ur
)
41 if (f2u (x
* y
) != ur
)
42 /* Set a variable rather than aborting here, to simplify tracing when
43 several computations are wrong. */
47 /* We don't want to make this const and static, or else we risk inlining
48 causing the test to fold as constants at compile-time. */
51 unsigned int p1
, p2
, res
;
54 {0xfff, 0x3f800400, 0xfff},
55 {0xf, 0x3fc88888, 0x17},
56 {0xf, 0x3f844444, 0xf}
60 main (int argc
, char *argv
[], char *envp
[])
64 for (i
= 0; i
< sizeof (expected
) / sizeof (expected
[0]); i
++)
66 tstmul (expected
[i
].p1
, expected
[i
].p2
, expected
[i
].res
);
67 tstmul (expected
[i
].p2
, expected
[i
].p1
, expected
[i
].res
);