No empty .Rs/.Re
[netbsd-mini2440.git] / regress / lib / libm / round / round.c
blob092fdb452d59a4f44128d1c0e51c28ed37461479
1 /* $NetBSD$ */
3 #include <math.h>
5 /*
6 * This tests for a bug in the initial implementation where precision
7 * was lost in an internal substraction, leading to rounding
8 * into the wrong direction.
9 */
11 /* 0.5 - EPSILON */
12 #define VAL 0x0.7ffffffffffffcp0
13 #define VALF 0x0.7fffff8p0
15 int main()
17 double a = VAL, b, c;
18 float af = VALF, bf, cf;
20 b = round(a);
21 bf = roundf(af);
22 c = round(-a);
23 cf = roundf(-af);
24 return (b != 0 || bf != 0 || c != 0 || cf != 0);