This source file includes following definitions.
- dummy
- 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 (floorf, float, (float));
25
26 #include "isnanf-nolibm.h"
27 #include "minus-zero.h"
28 #include "infinity.h"
29 #include "nan.h"
30 #include "macros.h"
31
32
33
34
35
36
37 static float
38 dummy (float f)
39 {
40 return 0;
41 }
42
43 int
44 main (int argc, _GL_UNUSED char **argv)
45 {
46 float (*my_floorf) (float) = argc ? floorf : dummy;
47
48
49 ASSERT (my_floorf (0.0f) == 0.0f);
50 ASSERT (my_floorf (minus_zerof) == 0.0f);
51
52 ASSERT (my_floorf (0.3f) == 0.0f);
53 ASSERT (my_floorf (0.7f) == 0.0f);
54 ASSERT (my_floorf (1.0f) == 1.0f);
55 ASSERT (my_floorf (1.5f) == 1.0f);
56 ASSERT (my_floorf (1.999f) == 1.0f);
57 ASSERT (my_floorf (2.0f) == 2.0f);
58 ASSERT (my_floorf (65535.99f) == 65535.0f);
59 ASSERT (my_floorf (65536.0f) == 65536.0f);
60 ASSERT (my_floorf (2.341e31f) == 2.341e31f);
61
62 ASSERT (my_floorf (-0.3f) == -1.0f);
63 ASSERT (my_floorf (-0.7f) == -1.0f);
64 ASSERT (my_floorf (-1.0f) == -1.0f);
65 ASSERT (my_floorf (-1.001f) == -2.0f);
66 ASSERT (my_floorf (-1.5f) == -2.0f);
67 ASSERT (my_floorf (-1.999f) == -2.0f);
68 ASSERT (my_floorf (-2.0f) == -2.0f);
69 ASSERT (my_floorf (-65535.99f) == -65536.0f);
70 ASSERT (my_floorf (-65536.0f) == -65536.0f);
71 ASSERT (my_floorf (-2.341e31f) == -2.341e31f);
72
73 ASSERT (my_floorf (Infinityf ()) == Infinityf ());
74 ASSERT (my_floorf (- Infinityf ()) == - Infinityf ());
75
76 ASSERT (isnanf (my_floorf (NaNf ())));
77
78 return 0;
79 }