This source file includes following definitions.
- main
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 #include <config.h>
20
21 #include <math.h>
22
23 #include "signature.h"
24 SIGNATURE_CHECK (rintl, long double, (long double));
25
26 #include <float.h>
27 #include <stdio.h>
28
29 #include "fpucw.h"
30 #include "isnanl-nolibm.h"
31 #include "minus-zero.h"
32 #include "infinity.h"
33 #include "nan.h"
34 #include "macros.h"
35
36 #undef INFINITY
37 #undef NAN
38
39 #define DOUBLE long double
40 #define ISNAN isnanl
41 #define INFINITY Infinityl ()
42 #define NAN NaNl ()
43 #define L_(literal) literal##L
44 #define RINT rintl
45 #define RANDOM randoml
46 #include "test-rint.h"
47
48 int
49 main ()
50 {
51 DECL_LONG_DOUBLE_ROUNDING
52
53 BEGIN_LONG_DOUBLE_ROUNDING ();
54
55
56
57 if (FLT_ROUNDS == 1)
58 {
59
60
61
62
63 ASSERT (rintl (0.0L) == 0.0L);
64 ASSERT (rintl (minus_zerol) == 0.0L);
65
66 ASSERT (rintl (0.3L) == 0.0L);
67 ASSERT (rintl (0.5L) == 0.0L);
68 ASSERT (rintl (0.7L) == 1.0L);
69 ASSERT (rintl (1.0L) == 1.0L);
70 ASSERT (rintl (1.5L) == 2.0L);
71 ASSERT (rintl (1.999L) == 2.0L);
72 ASSERT (rintl (2.0L) == 2.0L);
73 ASSERT (rintl (2.1L) == 2.0L);
74 ASSERT (rintl (2.5L) == 2.0L);
75 ASSERT (rintl (2.7L) == 3.0L);
76 ASSERT (rintl (65535.999L) == 65536.0L);
77 ASSERT (rintl (65536.0L) == 65536.0L);
78 ASSERT (rintl (65536.001L) == 65536.0L);
79 ASSERT (rintl (2.341e31L) == 2.341e31L);
80
81 ASSERT (rintl (-0.3L) == 0.0L);
82 ASSERT (rintl (-0.5L) == 0.0L);
83 ASSERT (rintl (-0.7L) == -1.0L);
84 ASSERT (rintl (-1.0L) == -1.0L);
85 ASSERT (rintl (-1.5L) == -2.0L);
86 ASSERT (rintl (-1.999L) == -2.0L);
87 ASSERT (rintl (-2.0L) == -2.0L);
88 ASSERT (rintl (-2.1L) == -2.0L);
89 ASSERT (rintl (-2.5L) == -2.0L);
90 ASSERT (rintl (-2.7L) == -3.0L);
91 ASSERT (rintl (-65535.999L) == -65536.0L);
92 ASSERT (rintl (-65536.0L) == -65536.0L);
93 ASSERT (rintl (-65536.001L) == -65536.0L);
94 ASSERT (rintl (-2.341e31L) == -2.341e31L);
95
96 test_function ();
97
98 return 0;
99 }
100 else
101 {
102 fputs ("Skipping test: non-standard rounding mode\n", stderr);
103 return 77;
104 }
105 }