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
20 #include <config.h>
21
22 #include <math.h>
23
24 #include "signature.h"
25 SIGNATURE_CHECK (roundl, long double, (long double));
26
27 #include <float.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 int
37 main ()
38 {
39 DECL_LONG_DOUBLE_ROUNDING
40
41 BEGIN_LONG_DOUBLE_ROUNDING ();
42
43
44 ASSERT (roundl (0.0L) == 0.0L);
45 ASSERT (roundl (minus_zerol) == 0.0L);
46
47 ASSERT (roundl (0.3L) == 0.0L);
48 ASSERT (roundl (0.5L) == 1.0L);
49 ASSERT (roundl (0.7L) == 1.0L);
50 ASSERT (roundl (1.0L) == 1.0L);
51 ASSERT (roundl (1.5L) == 2.0L);
52 ASSERT (roundl (2.5L) == 3.0L);
53 ASSERT (roundl (1.999L) == 2.0L);
54 ASSERT (roundl (2.0L) == 2.0L);
55 ASSERT (roundl (65535.999L) == 65536.0L);
56 ASSERT (roundl (65536.0L) == 65536.0L);
57 ASSERT (roundl (65536.001L) == 65536.0L);
58 ASSERT (roundl (2.341e31L) == 2.341e31L);
59
60 ASSERT (roundl (-0.3L) == 0.0L);
61 ASSERT (roundl (-0.5L) == -1.0L);
62 ASSERT (roundl (-0.7L) == -1.0L);
63 ASSERT (roundl (-1.0L) == -1.0L);
64 ASSERT (roundl (-1.5L) == -2.0L);
65 ASSERT (roundl (-2.5L) == -3.0L);
66 ASSERT (roundl (-1.999L) == -2.0L);
67 ASSERT (roundl (-2.0L) == -2.0L);
68 ASSERT (roundl (-65535.999L) == -65536.0L);
69 ASSERT (roundl (-65536.0L) == -65536.0L);
70 ASSERT (roundl (-65536.001L) == -65536.0L);
71 ASSERT (roundl (-2.341e31L) == -2.341e31L);
72
73 ASSERT (roundl (Infinityl ()) == Infinityl ());
74 ASSERT (roundl (- Infinityl ()) == - Infinityl ());
75
76 ASSERT (isnanl (roundl (NaNl ())));
77
78 return 0;
79 }