1 /* $NetBSD: round.c,v 1.2 1995/04/20 22:39:37 cgd Exp $ */
4 * Written by J.T. Conklin, Apr 18, 1995
17 * This test would be better if it actually performed some
18 * calculations to verify the selected rounding mode. But
19 * this is probably acceptable since the fp{get,set}round
20 * functions usually just get or set the processors fpu
24 assert(fpgetround() == FP_RN
);
25 assert(FLT_ROUNDS
== 1);
27 assert(fpsetround(FP_RP
) == FP_RN
);
28 assert(fpgetround() == FP_RP
);
29 assert(FLT_ROUNDS
== 2);
31 assert(fpsetround(FP_RM
) == FP_RP
);
32 assert(fpgetround() == FP_RM
);
33 assert(FLT_ROUNDS
== 3);
35 assert(fpsetround(FP_RZ
) == FP_RM
);
36 assert(fpgetround() == FP_RZ
);
37 assert(FLT_ROUNDS
== 0);
39 assert(fpsetround(FP_RN
) == FP_RZ
);
40 assert(fpgetround() == FP_RN
);
41 assert(FLT_ROUNDS
== 1);