1 | // Copyright (c) Microsoft Corporation. |
2 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
3 | |
4 | #ifndef FLOAT_GENERAL_PRECISION_TO_CHARS_TEST_CASES_HPP |
5 | #define FLOAT_GENERAL_PRECISION_TO_CHARS_TEST_CASES_HPP |
6 | |
7 | #include <charconv> |
8 | |
9 | #include "test.hpp" |
10 | using namespace std; |
11 | |
12 | // C11 7.21.6.1 "The fprintf function"/8: |
13 | |
14 | // "Then, if a conversion with style E would have an exponent of X: |
15 | // - if P > X >= -4, the conversion is with style f (or F) and precision P - (X + 1). |
16 | // - otherwise, the conversion is with style e (or E) and precision P - 1." |
17 | |
18 | // "Finally, [...] any trailing zeros are removed from the fractional portion of the result |
19 | // and the decimal-point character is removed if there is no fractional portion remaining." |
20 | |
21 | inline constexpr FloatPrecisionToCharsTestCase float_general_precision_to_chars_test_cases[] = { |
22 | // Test special cases (zero, inf, nan) and an ordinary case. Also test negative signs. |
23 | {.value: 0.0f, .fmt: chars_format::general, .precision: 4, .correct: "0" }, |
24 | {.value: -0.0f, .fmt: chars_format::general, .precision: 4, .correct: "-0" }, |
25 | {.value: float_inf, .fmt: chars_format::general, .precision: 4, .correct: "inf" }, |
26 | {.value: -float_inf, .fmt: chars_format::general, .precision: 4, .correct: "-inf" }, |
27 | {.value: float_nan, .fmt: chars_format::general, .precision: 4, .correct: "nan" }, |
28 | {.value: -float_nan, .fmt: chars_format::general, .precision: 4, .correct: "-nan(ind)" }, |
29 | {.value: float_nan_payload, .fmt: chars_format::general, .precision: 4, .correct: "nan" }, |
30 | {.value: -float_nan_payload, .fmt: chars_format::general, .precision: 4, .correct: "-nan" }, |
31 | {.value: 1.729f, .fmt: chars_format::general, .precision: 4, .correct: "1.729" }, |
32 | {.value: -1.729f, .fmt: chars_format::general, .precision: 4, .correct: "-1.729" }, |
33 | |
34 | // Test corner cases. |
35 | {.value: 0x0.000002p-126f, .fmt: chars_format::general, .precision: 1000, |
36 | .correct: "1.40129846432481707092372958328991613128026194187651577175706828388979108268586060148663818836212158203125" |
37 | "e-45" }, // min subnormal |
38 | {.value: 0x0.fffffep-126f, .fmt: chars_format::general, .precision: 1000, |
39 | .correct: "1." |
40 | "17549421069244107548702944484928734882705242874589333385717453057158887047561890426550235133618116378784179687" |
41 | "5e-38" }, // max subnormal |
42 | {.value: 0x1p-126f, .fmt: chars_format::general, .precision: 1000, |
43 | .correct: "1.1754943508222875079687365372222456778186655567720875215087517062784172594547271728515625e-38" }, // min normal |
44 | {.value: 0x1.fffffep+127f, .fmt: chars_format::general, .precision: 1000, .correct: "340282346638528859811704183484516925440" }, // max normal |
45 | |
46 | {.value: 0x0.000002p-126f, .fmt: chars_format::general, .precision: 6, .correct: "1.4013e-45" }, // min subnormal |
47 | {.value: 0x0.fffffep-126f, .fmt: chars_format::general, .precision: 6, .correct: "1.17549e-38" }, // max subnormal |
48 | {.value: 0x1p-126f, .fmt: chars_format::general, .precision: 6, .correct: "1.17549e-38" }, // min normal |
49 | {.value: 0x1.fffffep+127f, .fmt: chars_format::general, .precision: 6, .correct: "3.40282e+38" }, // max normal |
50 | |
51 | // Test maximum-length output (excluding minus signs). |
52 | {.value: 0x1.fffffep-126f, .fmt: chars_format::general, .precision: 1000, |
53 | .correct: "2." |
54 | "35098856151472858345576598207153302664571798551798085536592623685000612993034607711706485133618116378784179687" |
55 | "5e-38" }, // scientific, happens to be the same length as max subnormal |
56 | {.value: 0x1.fffffep-14f, .fmt: chars_format::general, .precision: 1000, .correct: "0.0001220703052240423858165740966796875" }, // fixed |
57 | |
58 | // Test varying precision. Negative precision requests P == 6. Zero precision requests P == 1. |
59 | // Here, the scientific exponent X is 0. |
60 | // Therefore, fixed notation is always chosen with precision P - (X + 1) == P - 1. |
61 | {.value: 0x1.b04p0f, .fmt: chars_format::general, .precision: -2, .correct: "1.68848" }, |
62 | {.value: 0x1.b04p0f, .fmt: chars_format::general, .precision: -1, .correct: "1.68848" }, |
63 | {.value: 0x1.b04p0f, .fmt: chars_format::general, .precision: 0, .correct: "2" }, |
64 | {.value: 0x1.b04p0f, .fmt: chars_format::general, .precision: 1, .correct: "2" }, // fixed notation trims decimal point |
65 | {.value: 0x1.b04p0f, .fmt: chars_format::general, .precision: 2, .correct: "1.7" }, |
66 | {.value: 0x1.b04p0f, .fmt: chars_format::general, .precision: 3, .correct: "1.69" }, |
67 | {.value: 0x1.b04p0f, .fmt: chars_format::general, .precision: 4, .correct: "1.688" }, |
68 | {.value: 0x1.b04p0f, .fmt: chars_format::general, .precision: 5, .correct: "1.6885" }, |
69 | {.value: 0x1.b04p0f, .fmt: chars_format::general, .precision: 6, .correct: "1.68848" }, |
70 | {.value: 0x1.b04p0f, .fmt: chars_format::general, .precision: 7, .correct: "1.688477" }, |
71 | {.value: 0x1.b04p0f, .fmt: chars_format::general, .precision: 8, .correct: "1.6884766" }, |
72 | {.value: 0x1.b04p0f, .fmt: chars_format::general, .precision: 9, .correct: "1.68847656" }, |
73 | {.value: 0x1.b04p0f, .fmt: chars_format::general, .precision: 10, .correct: "1.688476562" }, // round to even |
74 | {.value: 0x1.b04p0f, .fmt: chars_format::general, .precision: 11, .correct: "1.6884765625" }, // exact |
75 | {.value: 0x1.b04p0f, .fmt: chars_format::general, .precision: 12, .correct: "1.6884765625" }, // trim trailing zeros |
76 | {.value: 0x1.b04p0f, .fmt: chars_format::general, .precision: 13, .correct: "1.6884765625" }, |
77 | |
78 | // Here, the scientific exponent X is -5. |
79 | // Therefore, scientific notation is always chosen with precision P - 1. |
80 | {.value: 0x1.8p-15f, .fmt: chars_format::general, .precision: -2, .correct: "4.57764e-05" }, |
81 | {.value: 0x1.8p-15f, .fmt: chars_format::general, .precision: -1, .correct: "4.57764e-05" }, |
82 | {.value: 0x1.8p-15f, .fmt: chars_format::general, .precision: 0, .correct: "5e-05" }, |
83 | {.value: 0x1.8p-15f, .fmt: chars_format::general, .precision: 1, .correct: "5e-05" }, // scientific notation trims decimal point |
84 | {.value: 0x1.8p-15f, .fmt: chars_format::general, .precision: 2, .correct: "4.6e-05" }, |
85 | {.value: 0x1.8p-15f, .fmt: chars_format::general, .precision: 3, .correct: "4.58e-05" }, |
86 | {.value: 0x1.8p-15f, .fmt: chars_format::general, .precision: 4, .correct: "4.578e-05" }, |
87 | {.value: 0x1.8p-15f, .fmt: chars_format::general, .precision: 5, .correct: "4.5776e-05" }, |
88 | {.value: 0x1.8p-15f, .fmt: chars_format::general, .precision: 6, .correct: "4.57764e-05" }, |
89 | {.value: 0x1.8p-15f, .fmt: chars_format::general, .precision: 7, .correct: "4.577637e-05" }, |
90 | {.value: 0x1.8p-15f, .fmt: chars_format::general, .precision: 8, .correct: "4.5776367e-05" }, |
91 | {.value: 0x1.8p-15f, .fmt: chars_format::general, .precision: 9, .correct: "4.57763672e-05" }, |
92 | {.value: 0x1.8p-15f, .fmt: chars_format::general, .precision: 10, .correct: "4.577636719e-05" }, |
93 | {.value: 0x1.8p-15f, .fmt: chars_format::general, .precision: 11, .correct: "4.5776367188e-05" }, // round to even |
94 | {.value: 0x1.8p-15f, .fmt: chars_format::general, .precision: 12, .correct: "4.57763671875e-05" }, // exact |
95 | {.value: 0x1.8p-15f, .fmt: chars_format::general, .precision: 13, .correct: "4.57763671875e-05" }, // trim trailing zeros |
96 | {.value: 0x1.8p-15f, .fmt: chars_format::general, .precision: 14, .correct: "4.57763671875e-05" }, |
97 | |
98 | // Trim trailing zeros. |
99 | {.value: 0x1.80015p0f, .fmt: chars_format::general, .precision: 1, .correct: "2" }, // fixed notation trims decimal point |
100 | {.value: 0x1.80015p0f, .fmt: chars_format::general, .precision: 2, .correct: "1.5" }, |
101 | {.value: 0x1.80015p0f, .fmt: chars_format::general, .precision: 3, .correct: "1.5" }, // general trims trailing zeros |
102 | {.value: 0x1.80015p0f, .fmt: chars_format::general, .precision: 4, .correct: "1.5" }, |
103 | {.value: 0x1.80015p0f, .fmt: chars_format::general, .precision: 5, .correct: "1.5" }, |
104 | {.value: 0x1.80015p0f, .fmt: chars_format::general, .precision: 6, .correct: "1.50002" }, |
105 | {.value: 0x1.80015p0f, .fmt: chars_format::general, .precision: 7, .correct: "1.50002" }, |
106 | {.value: 0x1.80015p0f, .fmt: chars_format::general, .precision: 8, .correct: "1.50002" }, |
107 | {.value: 0x1.80015p0f, .fmt: chars_format::general, .precision: 9, .correct: "1.50002003" }, |
108 | {.value: 0x1.80015p0f, .fmt: chars_format::general, .precision: 10, .correct: "1.500020027" }, |
109 | {.value: 0x1.80015p0f, .fmt: chars_format::general, .precision: 11, .correct: "1.5000200272" }, |
110 | {.value: 0x1.80015p0f, .fmt: chars_format::general, .precision: 12, .correct: "1.50002002716" }, |
111 | {.value: 0x1.80015p0f, .fmt: chars_format::general, .precision: 13, .correct: "1.500020027161" }, |
112 | {.value: 0x1.80015p0f, .fmt: chars_format::general, .precision: 14, .correct: "1.5000200271606" }, |
113 | {.value: 0x1.80015p0f, .fmt: chars_format::general, .precision: 15, .correct: "1.50002002716064" }, |
114 | {.value: 0x1.80015p0f, .fmt: chars_format::general, .precision: 16, .correct: "1.500020027160645" }, |
115 | {.value: 0x1.80015p0f, .fmt: chars_format::general, .precision: 17, .correct: "1.5000200271606445" }, |
116 | {.value: 0x1.80015p0f, .fmt: chars_format::general, .precision: 18, .correct: "1.50002002716064453" }, |
117 | {.value: 0x1.80015p0f, .fmt: chars_format::general, .precision: 19, .correct: "1.500020027160644531" }, |
118 | {.value: 0x1.80015p0f, .fmt: chars_format::general, .precision: 20, .correct: "1.5000200271606445312" }, // round to even |
119 | {.value: 0x1.80015p0f, .fmt: chars_format::general, .precision: 21, .correct: "1.50002002716064453125" }, // exact |
120 | |
121 | // Trim trailing zeros and decimal point. |
122 | {.value: 0x1.00015p0f, .fmt: chars_format::general, .precision: 1, .correct: "1" }, // fixed notation trims decimal point |
123 | {.value: 0x1.00015p0f, .fmt: chars_format::general, .precision: 2, .correct: "1" }, // general trims decimal point and trailing zeros |
124 | {.value: 0x1.00015p0f, .fmt: chars_format::general, .precision: 3, .correct: "1" }, |
125 | {.value: 0x1.00015p0f, .fmt: chars_format::general, .precision: 4, .correct: "1" }, |
126 | {.value: 0x1.00015p0f, .fmt: chars_format::general, .precision: 5, .correct: "1" }, |
127 | {.value: 0x1.00015p0f, .fmt: chars_format::general, .precision: 6, .correct: "1.00002" }, |
128 | {.value: 0x1.00015p0f, .fmt: chars_format::general, .precision: 7, .correct: "1.00002" }, |
129 | {.value: 0x1.00015p0f, .fmt: chars_format::general, .precision: 8, .correct: "1.00002" }, |
130 | {.value: 0x1.00015p0f, .fmt: chars_format::general, .precision: 9, .correct: "1.00002003" }, |
131 | {.value: 0x1.00015p0f, .fmt: chars_format::general, .precision: 10, .correct: "1.000020027" }, |
132 | {.value: 0x1.00015p0f, .fmt: chars_format::general, .precision: 11, .correct: "1.0000200272" }, |
133 | {.value: 0x1.00015p0f, .fmt: chars_format::general, .precision: 12, .correct: "1.00002002716" }, |
134 | {.value: 0x1.00015p0f, .fmt: chars_format::general, .precision: 13, .correct: "1.000020027161" }, |
135 | {.value: 0x1.00015p0f, .fmt: chars_format::general, .precision: 14, .correct: "1.0000200271606" }, |
136 | {.value: 0x1.00015p0f, .fmt: chars_format::general, .precision: 15, .correct: "1.00002002716064" }, |
137 | {.value: 0x1.00015p0f, .fmt: chars_format::general, .precision: 16, .correct: "1.000020027160645" }, |
138 | {.value: 0x1.00015p0f, .fmt: chars_format::general, .precision: 17, .correct: "1.0000200271606445" }, |
139 | {.value: 0x1.00015p0f, .fmt: chars_format::general, .precision: 18, .correct: "1.00002002716064453" }, |
140 | {.value: 0x1.00015p0f, .fmt: chars_format::general, .precision: 19, .correct: "1.000020027160644531" }, |
141 | {.value: 0x1.00015p0f, .fmt: chars_format::general, .precision: 20, .correct: "1.0000200271606445312" }, // round to even |
142 | {.value: 0x1.00015p0f, .fmt: chars_format::general, .precision: 21, .correct: "1.00002002716064453125" }, // exact |
143 | |
144 | // Trim trailing zeros, scientific notation. |
145 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 1, .correct: "1e-06" }, // scientific notation trims decimal point |
146 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 2, .correct: "1.3e-06" }, |
147 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 3, .correct: "1.3e-06" }, // general trims trailing zeros |
148 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 4, .correct: "1.3e-06" }, |
149 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 5, .correct: "1.3e-06" }, |
150 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 6, .correct: "1.3e-06" }, |
151 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 7, .correct: "1.3e-06" }, |
152 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 8, .correct: "1.3e-06" }, |
153 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 9, .correct: "1.30000001e-06" }, |
154 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 10, .correct: "1.300000008e-06" }, |
155 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 11, .correct: "1.3000000081e-06" }, |
156 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 12, .correct: "1.30000000809e-06" }, |
157 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 13, .correct: "1.300000008086e-06" }, |
158 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 14, .correct: "1.3000000080865e-06" }, |
159 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 15, .correct: "1.3000000080865e-06" }, |
160 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 16, .correct: "1.300000008086499e-06" }, |
161 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 17, .correct: "1.3000000080864993e-06" }, |
162 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 18, .correct: "1.30000000808649929e-06" }, |
163 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 19, .correct: "1.300000008086499292e-06" }, |
164 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 20, .correct: "1.3000000080864992924e-06" }, |
165 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 21, .correct: "1.3000000080864992924e-06" }, |
166 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 22, .correct: "1.300000008086499292403e-06" }, |
167 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 23, .correct: "1.3000000080864992924035e-06" }, |
168 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 24, .correct: "1.30000000808649929240346e-06" }, |
169 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 25, .correct: "1.30000000808649929240346e-06" }, |
170 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 26, .correct: "1.3000000080864992924034595e-06" }, |
171 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 27, .correct: "1.30000000808649929240345955e-06" }, |
172 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 28, .correct: "1.300000008086499292403459549e-06" }, |
173 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 29, .correct: "1.300000008086499292403459549e-06" }, |
174 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 30, .correct: "1.30000000808649929240345954895e-06" }, |
175 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 31, .correct: "1.30000000808649929240345954895e-06" }, |
176 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 32, .correct: "1.3000000080864992924034595489502e-06" }, |
177 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 33, .correct: "1.3000000080864992924034595489502e-06" }, |
178 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 34, .correct: "1.300000008086499292403459548950195e-06" }, |
179 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 35, .correct: "1.3000000080864992924034595489501953e-06" }, |
180 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 36, .correct: "1.30000000808649929240345954895019531e-06" }, |
181 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 37, .correct: "1.300000008086499292403459548950195312e-06" }, // round to even |
182 | {.value: 0x1.5cf752p-20f, .fmt: chars_format::general, .precision: 38, .correct: "1.3000000080864992924034595489501953125e-06" }, // exact |
183 | |
184 | // Trim trailing zeros and decimal point, scientific notation. |
185 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 1, .correct: "3e-06" }, // scientific notation trims decimal point |
186 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 2, .correct: "3e-06" }, // general trims decimal point and trailing zeros |
187 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 3, .correct: "3e-06" }, |
188 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 4, .correct: "3e-06" }, |
189 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 5, .correct: "3e-06" }, |
190 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 6, .correct: "3e-06" }, |
191 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 7, .correct: "3e-06" }, |
192 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 8, .correct: "3.0000001e-06" }, |
193 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 9, .correct: "3.00000011e-06" }, |
194 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 10, .correct: "3.000000106e-06" }, |
195 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 11, .correct: "3.0000001061e-06" }, |
196 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 12, .correct: "3.00000010611e-06" }, |
197 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 13, .correct: "3.000000106113e-06" }, |
198 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 14, .correct: "3.0000001061126e-06" }, |
199 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 15, .correct: "3.00000010611257e-06" }, |
200 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 16, .correct: "3.000000106112566e-06" }, |
201 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 17, .correct: "3.0000001061125658e-06" }, |
202 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 18, .correct: "3.00000010611256585e-06" }, |
203 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 19, .correct: "3.000000106112565845e-06" }, |
204 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 20, .correct: "3.0000001061125658453e-06" }, |
205 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 21, .correct: "3.00000010611256584525e-06" }, |
206 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 22, .correct: "3.000000106112565845251e-06" }, |
207 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 23, .correct: "3.0000001061125658452511e-06" }, |
208 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 24, .correct: "3.00000010611256584525108e-06" }, |
209 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 25, .correct: "3.000000106112565845251083e-06" }, |
210 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 26, .correct: "3.0000001061125658452510834e-06" }, |
211 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 27, .correct: "3.00000010611256584525108337e-06" }, |
212 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 28, .correct: "3.000000106112565845251083374e-06" }, |
213 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 29, .correct: "3.000000106112565845251083374e-06" }, |
214 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 30, .correct: "3.00000010611256584525108337402e-06" }, |
215 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 31, .correct: "3.000000106112565845251083374023e-06" }, |
216 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 32, .correct: "3.0000001061125658452510833740234e-06" }, |
217 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 33, .correct: "3.00000010611256584525108337402344e-06" }, |
218 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 34, .correct: "3.000000106112565845251083374023438e-06" }, // round to even |
219 | {.value: 0x1.92a738p-19f, .fmt: chars_format::general, .precision: 35, .correct: "3.0000001061125658452510833740234375e-06" }, // exact |
220 | |
221 | // Test a large precision with fixed notation and scientific notation, |
222 | // verifying that we remain within the bounds of any lookup tables. |
223 | {.value: 0x1.ba9fbep+0f, .fmt: chars_format::general, .precision: 5000, .correct: "1.72899997234344482421875" }, |
224 | {.value: 0x1.d01ffap-20f, .fmt: chars_format::general, .precision: 5000, .correct: "1.7290000187131226994097232818603515625e-06" }, |
225 | |
226 | // Test the transitions between fixed notation and scientific notation. |
227 | {.value: 5555555.0f, .fmt: chars_format::general, .precision: 1, .correct: "6e+06" }, |
228 | {.value: 555555.0f, .fmt: chars_format::general, .precision: 1, .correct: "6e+05" }, |
229 | {.value: 55555.0f, .fmt: chars_format::general, .precision: 1, .correct: "6e+04" }, |
230 | {.value: 5555.0f, .fmt: chars_format::general, .precision: 1, .correct: "6e+03" }, |
231 | {.value: 555.0f, .fmt: chars_format::general, .precision: 1, .correct: "6e+02" }, |
232 | {.value: 55.0f, .fmt: chars_format::general, .precision: 1, .correct: "6e+01" }, // round to even |
233 | {.value: 5.0f, .fmt: chars_format::general, .precision: 1, .correct: "5" }, |
234 | {.value: 0x1p-3f, .fmt: chars_format::general, .precision: 1, .correct: "0.1" }, // 0.125 |
235 | {.value: 0x1p-6f, .fmt: chars_format::general, .precision: 1, .correct: "0.02" }, // 0.015625 |
236 | {.value: 0x1p-9f, .fmt: chars_format::general, .precision: 1, .correct: "0.002" }, // 0.001953125 |
237 | {.value: 0x1p-13f, .fmt: chars_format::general, .precision: 1, .correct: "0.0001" }, // 0.0001220703125 |
238 | {.value: 0x1p-16f, .fmt: chars_format::general, .precision: 1, .correct: "2e-05" }, // 1.52587890625e-05 |
239 | {.value: 0x1p-19f, .fmt: chars_format::general, .precision: 1, .correct: "2e-06" }, // 1.9073486328125e-06 |
240 | |
241 | {.value: 5555555.0f, .fmt: chars_format::general, .precision: 2, .correct: "5.6e+06" }, |
242 | {.value: 555555.0f, .fmt: chars_format::general, .precision: 2, .correct: "5.6e+05" }, |
243 | {.value: 55555.0f, .fmt: chars_format::general, .precision: 2, .correct: "5.6e+04" }, |
244 | {.value: 5555.0f, .fmt: chars_format::general, .precision: 2, .correct: "5.6e+03" }, |
245 | {.value: 555.0f, .fmt: chars_format::general, .precision: 2, .correct: "5.6e+02" }, // round to even |
246 | {.value: 55.0f, .fmt: chars_format::general, .precision: 2, .correct: "55" }, |
247 | {.value: 5.0f, .fmt: chars_format::general, .precision: 2, .correct: "5" }, |
248 | {.value: 0x1p-3f, .fmt: chars_format::general, .precision: 2, .correct: "0.12" }, // round to even |
249 | {.value: 0x1p-6f, .fmt: chars_format::general, .precision: 2, .correct: "0.016" }, |
250 | {.value: 0x1p-9f, .fmt: chars_format::general, .precision: 2, .correct: "0.002" }, |
251 | {.value: 0x1p-13f, .fmt: chars_format::general, .precision: 2, .correct: "0.00012" }, |
252 | {.value: 0x1p-16f, .fmt: chars_format::general, .precision: 2, .correct: "1.5e-05" }, |
253 | {.value: 0x1p-19f, .fmt: chars_format::general, .precision: 2, .correct: "1.9e-06" }, |
254 | |
255 | {.value: 5555555.0f, .fmt: chars_format::general, .precision: 3, .correct: "5.56e+06" }, |
256 | {.value: 555555.0f, .fmt: chars_format::general, .precision: 3, .correct: "5.56e+05" }, |
257 | {.value: 55555.0f, .fmt: chars_format::general, .precision: 3, .correct: "5.56e+04" }, |
258 | {.value: 5555.0f, .fmt: chars_format::general, .precision: 3, .correct: "5.56e+03" }, // round to even |
259 | {.value: 555.0f, .fmt: chars_format::general, .precision: 3, .correct: "555" }, |
260 | {.value: 55.0f, .fmt: chars_format::general, .precision: 3, .correct: "55" }, |
261 | {.value: 5.0f, .fmt: chars_format::general, .precision: 3, .correct: "5" }, |
262 | {.value: 0x1p-3f, .fmt: chars_format::general, .precision: 3, .correct: "0.125" }, |
263 | {.value: 0x1p-6f, .fmt: chars_format::general, .precision: 3, .correct: "0.0156" }, |
264 | {.value: 0x1p-9f, .fmt: chars_format::general, .precision: 3, .correct: "0.00195" }, |
265 | {.value: 0x1p-13f, .fmt: chars_format::general, .precision: 3, .correct: "0.000122" }, |
266 | {.value: 0x1p-16f, .fmt: chars_format::general, .precision: 3, .correct: "1.53e-05" }, |
267 | {.value: 0x1p-19f, .fmt: chars_format::general, .precision: 3, .correct: "1.91e-06" }, |
268 | |
269 | {.value: 5555555.0f, .fmt: chars_format::general, .precision: 4, .correct: "5.556e+06" }, |
270 | {.value: 555555.0f, .fmt: chars_format::general, .precision: 4, .correct: "5.556e+05" }, |
271 | {.value: 55555.0f, .fmt: chars_format::general, .precision: 4, .correct: "5.556e+04" }, // round to even |
272 | {.value: 5555.0f, .fmt: chars_format::general, .precision: 4, .correct: "5555" }, |
273 | {.value: 555.0f, .fmt: chars_format::general, .precision: 4, .correct: "555" }, |
274 | {.value: 55.0f, .fmt: chars_format::general, .precision: 4, .correct: "55" }, |
275 | {.value: 5.0f, .fmt: chars_format::general, .precision: 4, .correct: "5" }, |
276 | {.value: 0x1p-3f, .fmt: chars_format::general, .precision: 4, .correct: "0.125" }, |
277 | {.value: 0x1p-6f, .fmt: chars_format::general, .precision: 4, .correct: "0.01562" }, // round to even |
278 | {.value: 0x1p-9f, .fmt: chars_format::general, .precision: 4, .correct: "0.001953" }, |
279 | {.value: 0x1p-13f, .fmt: chars_format::general, .precision: 4, .correct: "0.0001221" }, |
280 | {.value: 0x1p-16f, .fmt: chars_format::general, .precision: 4, .correct: "1.526e-05" }, |
281 | {.value: 0x1p-19f, .fmt: chars_format::general, .precision: 4, .correct: "1.907e-06" }, |
282 | |
283 | {.value: 5555555.0f, .fmt: chars_format::general, .precision: 5, .correct: "5.5556e+06" }, |
284 | {.value: 555555.0f, .fmt: chars_format::general, .precision: 5, .correct: "5.5556e+05" }, // round to even |
285 | {.value: 55555.0f, .fmt: chars_format::general, .precision: 5, .correct: "55555" }, |
286 | {.value: 5555.0f, .fmt: chars_format::general, .precision: 5, .correct: "5555" }, |
287 | {.value: 555.0f, .fmt: chars_format::general, .precision: 5, .correct: "555" }, |
288 | {.value: 55.0f, .fmt: chars_format::general, .precision: 5, .correct: "55" }, |
289 | {.value: 5.0f, .fmt: chars_format::general, .precision: 5, .correct: "5" }, |
290 | {.value: 0x1p-3f, .fmt: chars_format::general, .precision: 5, .correct: "0.125" }, |
291 | {.value: 0x1p-6f, .fmt: chars_format::general, .precision: 5, .correct: "0.015625" }, |
292 | {.value: 0x1p-9f, .fmt: chars_format::general, .precision: 5, .correct: "0.0019531" }, |
293 | {.value: 0x1p-13f, .fmt: chars_format::general, .precision: 5, .correct: "0.00012207" }, |
294 | {.value: 0x1p-16f, .fmt: chars_format::general, .precision: 5, .correct: "1.5259e-05" }, |
295 | {.value: 0x1p-19f, .fmt: chars_format::general, .precision: 5, .correct: "1.9073e-06" }, |
296 | |
297 | // Tricky corner cases. |
298 | // In these scenarios, rounding can adjust the scientific exponent X, |
299 | // which affects the transition between fixed notation and scientific notation. |
300 | {.value: 999.999f, .fmt: chars_format::general, .precision: 1, .correct: "1e+03" }, // "%.0e" is "1e+03"; X == 3 |
301 | {.value: 999.999f, .fmt: chars_format::general, .precision: 2, .correct: "1e+03" }, // "%.1e" is "1.0e+03"; X == 3 |
302 | {.value: 999.999f, .fmt: chars_format::general, .precision: 3, .correct: "1e+03" }, // "%.2e" is "1.00e+03"; X == 3 |
303 | {.value: 999.999f, .fmt: chars_format::general, .precision: 4, .correct: "1000" }, // "%.3e" is "1.000e+03"; X == 3 |
304 | {.value: 999.999f, .fmt: chars_format::general, .precision: 5, .correct: "1000" }, // "%.4e" is "1.0000e+03"; X == 3 |
305 | {.value: 999.999f, .fmt: chars_format::general, .precision: 6, .correct: "999.999" }, // "%.5e" is "9.99999e+02"; X == 2 |
306 | |
307 | {.value: 999.99f, .fmt: chars_format::general, .precision: 1, .correct: "1e+03" }, |
308 | {.value: 999.99f, .fmt: chars_format::general, .precision: 2, .correct: "1e+03" }, |
309 | {.value: 999.99f, .fmt: chars_format::general, .precision: 3, .correct: "1e+03" }, |
310 | {.value: 999.99f, .fmt: chars_format::general, .precision: 4, .correct: "1000" }, |
311 | {.value: 999.99f, .fmt: chars_format::general, .precision: 5, .correct: "999.99" }, |
312 | {.value: 999.99f, .fmt: chars_format::general, .precision: 6, .correct: "999.99" }, |
313 | |
314 | // C11's Standardese is slightly vague about how to perform the trial formatting in scientific notation, |
315 | // but the intention is to use precision P - 1, which is what's used when scientific notation is actually chosen. |
316 | // This example verifies this behavior. Here, P == 3 performs trial formatting with "%.2e", triggering rounding. |
317 | // That increases X to 3, forcing scientific notation to be chosen. |
318 | // If P == 3 performed trial formatting with "%.3e", rounding wouldn't happen, |
319 | // X would be 2, and fixed notation would be chosen. |
320 | {.value: 999.9f, .fmt: chars_format::general, .precision: 1, .correct: "1e+03" }, // "%.0e" is "1e+03"; X == 3 |
321 | {.value: 999.9f, .fmt: chars_format::general, .precision: 2, .correct: "1e+03" }, // "%.1e" is "1.0e+03"; X == 3 |
322 | {.value: 999.9f, .fmt: chars_format::general, .precision: 3, .correct: "1e+03" }, // "%.2e" is "1.00e+03"; X == 3; SPECIAL CORNER CASE |
323 | {.value: 999.9f, .fmt: chars_format::general, .precision: 4, .correct: "999.9" }, // "%.3e" is "9.999e+02"; X == 2 |
324 | {.value: 999.9f, .fmt: chars_format::general, .precision: 5, .correct: "999.9" }, // "%.4e" is "9.9990e+02"; X == 2 |
325 | {.value: 999.9f, .fmt: chars_format::general, .precision: 6, .correct: "999.9" }, // "%.5e" is "9.99900e+02"; X == 2 |
326 | |
327 | {.value: 999.0f, .fmt: chars_format::general, .precision: 1, .correct: "1e+03" }, |
328 | {.value: 999.0f, .fmt: chars_format::general, .precision: 2, .correct: "1e+03" }, |
329 | {.value: 999.0f, .fmt: chars_format::general, .precision: 3, .correct: "999" }, |
330 | {.value: 999.0f, .fmt: chars_format::general, .precision: 4, .correct: "999" }, |
331 | {.value: 999.0f, .fmt: chars_format::general, .precision: 5, .correct: "999" }, |
332 | {.value: 999.0f, .fmt: chars_format::general, .precision: 6, .correct: "999" }, |
333 | |
334 | {.value: 99.9999f, .fmt: chars_format::general, .precision: 1, .correct: "1e+02" }, |
335 | {.value: 99.9999f, .fmt: chars_format::general, .precision: 2, .correct: "1e+02" }, |
336 | {.value: 99.9999f, .fmt: chars_format::general, .precision: 3, .correct: "100" }, |
337 | {.value: 99.9999f, .fmt: chars_format::general, .precision: 4, .correct: "100" }, |
338 | {.value: 99.9999f, .fmt: chars_format::general, .precision: 5, .correct: "100" }, |
339 | {.value: 99.9999f, .fmt: chars_format::general, .precision: 6, .correct: "99.9999" }, |
340 | |
341 | {.value: 99.999f, .fmt: chars_format::general, .precision: 1, .correct: "1e+02" }, |
342 | {.value: 99.999f, .fmt: chars_format::general, .precision: 2, .correct: "1e+02" }, |
343 | {.value: 99.999f, .fmt: chars_format::general, .precision: 3, .correct: "100" }, |
344 | {.value: 99.999f, .fmt: chars_format::general, .precision: 4, .correct: "100" }, |
345 | {.value: 99.999f, .fmt: chars_format::general, .precision: 5, .correct: "99.999" }, |
346 | {.value: 99.999f, .fmt: chars_format::general, .precision: 6, .correct: "99.999" }, |
347 | |
348 | {.value: 99.99f, .fmt: chars_format::general, .precision: 1, .correct: "1e+02" }, |
349 | {.value: 99.99f, .fmt: chars_format::general, .precision: 2, .correct: "1e+02" }, |
350 | {.value: 99.99f, .fmt: chars_format::general, .precision: 3, .correct: "100" }, |
351 | {.value: 99.99f, .fmt: chars_format::general, .precision: 4, .correct: "99.99" }, |
352 | {.value: 99.99f, .fmt: chars_format::general, .precision: 5, .correct: "99.99" }, |
353 | {.value: 99.99f, .fmt: chars_format::general, .precision: 6, .correct: "99.99" }, |
354 | |
355 | {.value: 99.9f, .fmt: chars_format::general, .precision: 1, .correct: "1e+02" }, |
356 | {.value: 99.9f, .fmt: chars_format::general, .precision: 2, .correct: "1e+02" }, |
357 | {.value: 99.9f, .fmt: chars_format::general, .precision: 3, .correct: "99.9" }, |
358 | {.value: 99.9f, .fmt: chars_format::general, .precision: 4, .correct: "99.9" }, |
359 | {.value: 99.9f, .fmt: chars_format::general, .precision: 5, .correct: "99.9" }, |
360 | {.value: 99.9f, .fmt: chars_format::general, .precision: 6, .correct: "99.9" }, |
361 | |
362 | {.value: 99.0f, .fmt: chars_format::general, .precision: 1, .correct: "1e+02" }, |
363 | {.value: 99.0f, .fmt: chars_format::general, .precision: 2, .correct: "99" }, |
364 | {.value: 99.0f, .fmt: chars_format::general, .precision: 3, .correct: "99" }, |
365 | {.value: 99.0f, .fmt: chars_format::general, .precision: 4, .correct: "99" }, |
366 | {.value: 99.0f, .fmt: chars_format::general, .precision: 5, .correct: "99" }, |
367 | {.value: 99.0f, .fmt: chars_format::general, .precision: 6, .correct: "99" }, |
368 | |
369 | {.value: 9.99999f, .fmt: chars_format::general, .precision: 1, .correct: "1e+01" }, |
370 | {.value: 9.99999f, .fmt: chars_format::general, .precision: 2, .correct: "10" }, |
371 | {.value: 9.99999f, .fmt: chars_format::general, .precision: 3, .correct: "10" }, |
372 | {.value: 9.99999f, .fmt: chars_format::general, .precision: 4, .correct: "10" }, |
373 | {.value: 9.99999f, .fmt: chars_format::general, .precision: 5, .correct: "10" }, |
374 | {.value: 9.99999f, .fmt: chars_format::general, .precision: 6, .correct: "9.99999" }, |
375 | |
376 | {.value: 9.9999f, .fmt: chars_format::general, .precision: 1, .correct: "1e+01" }, |
377 | {.value: 9.9999f, .fmt: chars_format::general, .precision: 2, .correct: "10" }, |
378 | {.value: 9.9999f, .fmt: chars_format::general, .precision: 3, .correct: "10" }, |
379 | {.value: 9.9999f, .fmt: chars_format::general, .precision: 4, .correct: "10" }, |
380 | {.value: 9.9999f, .fmt: chars_format::general, .precision: 5, .correct: "9.9999" }, |
381 | {.value: 9.9999f, .fmt: chars_format::general, .precision: 6, .correct: "9.9999" }, |
382 | |
383 | {.value: 9.999f, .fmt: chars_format::general, .precision: 1, .correct: "1e+01" }, |
384 | {.value: 9.999f, .fmt: chars_format::general, .precision: 2, .correct: "10" }, |
385 | {.value: 9.999f, .fmt: chars_format::general, .precision: 3, .correct: "10" }, |
386 | {.value: 9.999f, .fmt: chars_format::general, .precision: 4, .correct: "9.999" }, |
387 | {.value: 9.999f, .fmt: chars_format::general, .precision: 5, .correct: "9.999" }, |
388 | {.value: 9.999f, .fmt: chars_format::general, .precision: 6, .correct: "9.999" }, |
389 | |
390 | {.value: 9.99f, .fmt: chars_format::general, .precision: 1, .correct: "1e+01" }, |
391 | {.value: 9.99f, .fmt: chars_format::general, .precision: 2, .correct: "10" }, |
392 | {.value: 9.99f, .fmt: chars_format::general, .precision: 3, .correct: "9.99" }, |
393 | {.value: 9.99f, .fmt: chars_format::general, .precision: 4, .correct: "9.99" }, |
394 | {.value: 9.99f, .fmt: chars_format::general, .precision: 5, .correct: "9.99" }, |
395 | {.value: 9.99f, .fmt: chars_format::general, .precision: 6, .correct: "9.99" }, |
396 | |
397 | {.value: 9.9f, .fmt: chars_format::general, .precision: 1, .correct: "1e+01" }, |
398 | {.value: 9.9f, .fmt: chars_format::general, .precision: 2, .correct: "9.9" }, |
399 | {.value: 9.9f, .fmt: chars_format::general, .precision: 3, .correct: "9.9" }, |
400 | {.value: 9.9f, .fmt: chars_format::general, .precision: 4, .correct: "9.9" }, |
401 | {.value: 9.9f, .fmt: chars_format::general, .precision: 5, .correct: "9.9" }, |
402 | {.value: 9.9f, .fmt: chars_format::general, .precision: 6, .correct: "9.9" }, |
403 | |
404 | {.value: 9.0f, .fmt: chars_format::general, .precision: 1, .correct: "9" }, |
405 | {.value: 9.0f, .fmt: chars_format::general, .precision: 2, .correct: "9" }, |
406 | {.value: 9.0f, .fmt: chars_format::general, .precision: 3, .correct: "9" }, |
407 | {.value: 9.0f, .fmt: chars_format::general, .precision: 4, .correct: "9" }, |
408 | {.value: 9.0f, .fmt: chars_format::general, .precision: 5, .correct: "9" }, |
409 | {.value: 9.0f, .fmt: chars_format::general, .precision: 6, .correct: "9" }, |
410 | |
411 | {.value: 0.999999f, .fmt: chars_format::general, .precision: 1, .correct: "1" }, |
412 | {.value: 0.999999f, .fmt: chars_format::general, .precision: 2, .correct: "1" }, |
413 | {.value: 0.999999f, .fmt: chars_format::general, .precision: 3, .correct: "1" }, |
414 | {.value: 0.999999f, .fmt: chars_format::general, .precision: 4, .correct: "1" }, |
415 | {.value: 0.999999f, .fmt: chars_format::general, .precision: 5, .correct: "1" }, |
416 | {.value: 0.999999f, .fmt: chars_format::general, .precision: 6, .correct: "0.999999" }, |
417 | |
418 | {.value: 0.99999f, .fmt: chars_format::general, .precision: 1, .correct: "1" }, |
419 | {.value: 0.99999f, .fmt: chars_format::general, .precision: 2, .correct: "1" }, |
420 | {.value: 0.99999f, .fmt: chars_format::general, .precision: 3, .correct: "1" }, |
421 | {.value: 0.99999f, .fmt: chars_format::general, .precision: 4, .correct: "1" }, |
422 | {.value: 0.99999f, .fmt: chars_format::general, .precision: 5, .correct: "0.99999" }, |
423 | {.value: 0.99999f, .fmt: chars_format::general, .precision: 6, .correct: "0.99999" }, |
424 | |
425 | {.value: 0.9999f, .fmt: chars_format::general, .precision: 1, .correct: "1" }, |
426 | {.value: 0.9999f, .fmt: chars_format::general, .precision: 2, .correct: "1" }, |
427 | {.value: 0.9999f, .fmt: chars_format::general, .precision: 3, .correct: "1" }, |
428 | {.value: 0.9999f, .fmt: chars_format::general, .precision: 4, .correct: "0.9999" }, |
429 | {.value: 0.9999f, .fmt: chars_format::general, .precision: 5, .correct: "0.9999" }, |
430 | {.value: 0.9999f, .fmt: chars_format::general, .precision: 6, .correct: "0.9999" }, |
431 | |
432 | {.value: 0.999f, .fmt: chars_format::general, .precision: 1, .correct: "1" }, |
433 | {.value: 0.999f, .fmt: chars_format::general, .precision: 2, .correct: "1" }, |
434 | {.value: 0.999f, .fmt: chars_format::general, .precision: 3, .correct: "0.999" }, |
435 | {.value: 0.999f, .fmt: chars_format::general, .precision: 4, .correct: "0.999" }, |
436 | {.value: 0.999f, .fmt: chars_format::general, .precision: 5, .correct: "0.999" }, |
437 | {.value: 0.999f, .fmt: chars_format::general, .precision: 6, .correct: "0.999" }, |
438 | |
439 | {.value: 0.99f, .fmt: chars_format::general, .precision: 1, .correct: "1" }, |
440 | {.value: 0.99f, .fmt: chars_format::general, .precision: 2, .correct: "0.99" }, |
441 | {.value: 0.99f, .fmt: chars_format::general, .precision: 3, .correct: "0.99" }, |
442 | {.value: 0.99f, .fmt: chars_format::general, .precision: 4, .correct: "0.99" }, |
443 | {.value: 0.99f, .fmt: chars_format::general, .precision: 5, .correct: "0.99" }, |
444 | {.value: 0.99f, .fmt: chars_format::general, .precision: 6, .correct: "0.99" }, |
445 | |
446 | {.value: 0.9f, .fmt: chars_format::general, .precision: 1, .correct: "0.9" }, |
447 | {.value: 0.9f, .fmt: chars_format::general, .precision: 2, .correct: "0.9" }, |
448 | {.value: 0.9f, .fmt: chars_format::general, .precision: 3, .correct: "0.9" }, |
449 | {.value: 0.9f, .fmt: chars_format::general, .precision: 4, .correct: "0.9" }, |
450 | {.value: 0.9f, .fmt: chars_format::general, .precision: 5, .correct: "0.9" }, |
451 | {.value: 0.9f, .fmt: chars_format::general, .precision: 6, .correct: "0.9" }, |
452 | |
453 | {.value: 0.0999999f, .fmt: chars_format::general, .precision: 1, .correct: "0.1" }, |
454 | {.value: 0.0999999f, .fmt: chars_format::general, .precision: 2, .correct: "0.1" }, |
455 | {.value: 0.0999999f, .fmt: chars_format::general, .precision: 3, .correct: "0.1" }, |
456 | {.value: 0.0999999f, .fmt: chars_format::general, .precision: 4, .correct: "0.1" }, |
457 | {.value: 0.0999999f, .fmt: chars_format::general, .precision: 5, .correct: "0.1" }, |
458 | {.value: 0.0999999f, .fmt: chars_format::general, .precision: 6, .correct: "0.0999999" }, |
459 | |
460 | {.value: 0.099999f, .fmt: chars_format::general, .precision: 1, .correct: "0.1" }, |
461 | {.value: 0.099999f, .fmt: chars_format::general, .precision: 2, .correct: "0.1" }, |
462 | {.value: 0.099999f, .fmt: chars_format::general, .precision: 3, .correct: "0.1" }, |
463 | {.value: 0.099999f, .fmt: chars_format::general, .precision: 4, .correct: "0.1" }, |
464 | {.value: 0.099999f, .fmt: chars_format::general, .precision: 5, .correct: "0.099999" }, |
465 | {.value: 0.099999f, .fmt: chars_format::general, .precision: 6, .correct: "0.099999" }, |
466 | |
467 | {.value: 0.09999f, .fmt: chars_format::general, .precision: 1, .correct: "0.1" }, |
468 | {.value: 0.09999f, .fmt: chars_format::general, .precision: 2, .correct: "0.1" }, |
469 | {.value: 0.09999f, .fmt: chars_format::general, .precision: 3, .correct: "0.1" }, |
470 | {.value: 0.09999f, .fmt: chars_format::general, .precision: 4, .correct: "0.09999" }, |
471 | {.value: 0.09999f, .fmt: chars_format::general, .precision: 5, .correct: "0.09999" }, |
472 | {.value: 0.09999f, .fmt: chars_format::general, .precision: 6, .correct: "0.09999" }, |
473 | |
474 | {.value: 0.0999f, .fmt: chars_format::general, .precision: 1, .correct: "0.1" }, |
475 | {.value: 0.0999f, .fmt: chars_format::general, .precision: 2, .correct: "0.1" }, |
476 | {.value: 0.0999f, .fmt: chars_format::general, .precision: 3, .correct: "0.0999" }, |
477 | {.value: 0.0999f, .fmt: chars_format::general, .precision: 4, .correct: "0.0999" }, |
478 | {.value: 0.0999f, .fmt: chars_format::general, .precision: 5, .correct: "0.0999" }, |
479 | {.value: 0.0999f, .fmt: chars_format::general, .precision: 6, .correct: "0.0999" }, |
480 | |
481 | {.value: 0.099f, .fmt: chars_format::general, .precision: 1, .correct: "0.1" }, |
482 | {.value: 0.099f, .fmt: chars_format::general, .precision: 2, .correct: "0.099" }, |
483 | {.value: 0.099f, .fmt: chars_format::general, .precision: 3, .correct: "0.099" }, |
484 | {.value: 0.099f, .fmt: chars_format::general, .precision: 4, .correct: "0.099" }, |
485 | {.value: 0.099f, .fmt: chars_format::general, .precision: 5, .correct: "0.099" }, |
486 | {.value: 0.099f, .fmt: chars_format::general, .precision: 6, .correct: "0.099" }, |
487 | |
488 | {.value: 0.09f, .fmt: chars_format::general, .precision: 1, .correct: "0.09" }, |
489 | {.value: 0.09f, .fmt: chars_format::general, .precision: 2, .correct: "0.09" }, |
490 | {.value: 0.09f, .fmt: chars_format::general, .precision: 3, .correct: "0.09" }, |
491 | {.value: 0.09f, .fmt: chars_format::general, .precision: 4, .correct: "0.09" }, |
492 | {.value: 0.09f, .fmt: chars_format::general, .precision: 5, .correct: "0.09" }, |
493 | {.value: 0.09f, .fmt: chars_format::general, .precision: 6, .correct: "0.09" }, |
494 | |
495 | {.value: 0.00999999f, .fmt: chars_format::general, .precision: 1, .correct: "0.01" }, |
496 | {.value: 0.00999999f, .fmt: chars_format::general, .precision: 2, .correct: "0.01" }, |
497 | {.value: 0.00999999f, .fmt: chars_format::general, .precision: 3, .correct: "0.01" }, |
498 | {.value: 0.00999999f, .fmt: chars_format::general, .precision: 4, .correct: "0.01" }, |
499 | {.value: 0.00999999f, .fmt: chars_format::general, .precision: 5, .correct: "0.01" }, |
500 | {.value: 0.00999999f, .fmt: chars_format::general, .precision: 6, .correct: "0.00999999" }, |
501 | |
502 | {.value: 0.0099999f, .fmt: chars_format::general, .precision: 1, .correct: "0.01" }, |
503 | {.value: 0.0099999f, .fmt: chars_format::general, .precision: 2, .correct: "0.01" }, |
504 | {.value: 0.0099999f, .fmt: chars_format::general, .precision: 3, .correct: "0.01" }, |
505 | {.value: 0.0099999f, .fmt: chars_format::general, .precision: 4, .correct: "0.01" }, |
506 | {.value: 0.0099999f, .fmt: chars_format::general, .precision: 5, .correct: "0.0099999" }, |
507 | {.value: 0.0099999f, .fmt: chars_format::general, .precision: 6, .correct: "0.0099999" }, |
508 | |
509 | {.value: 0.009999f, .fmt: chars_format::general, .precision: 1, .correct: "0.01" }, |
510 | {.value: 0.009999f, .fmt: chars_format::general, .precision: 2, .correct: "0.01" }, |
511 | {.value: 0.009999f, .fmt: chars_format::general, .precision: 3, .correct: "0.01" }, |
512 | {.value: 0.009999f, .fmt: chars_format::general, .precision: 4, .correct: "0.009999" }, |
513 | {.value: 0.009999f, .fmt: chars_format::general, .precision: 5, .correct: "0.009999" }, |
514 | {.value: 0.009999f, .fmt: chars_format::general, .precision: 6, .correct: "0.009999" }, |
515 | |
516 | {.value: 0.00999f, .fmt: chars_format::general, .precision: 1, .correct: "0.01" }, |
517 | {.value: 0.00999f, .fmt: chars_format::general, .precision: 2, .correct: "0.01" }, |
518 | {.value: 0.00999f, .fmt: chars_format::general, .precision: 3, .correct: "0.00999" }, |
519 | {.value: 0.00999f, .fmt: chars_format::general, .precision: 4, .correct: "0.00999" }, |
520 | {.value: 0.00999f, .fmt: chars_format::general, .precision: 5, .correct: "0.00999" }, |
521 | {.value: 0.00999f, .fmt: chars_format::general, .precision: 6, .correct: "0.00999" }, |
522 | |
523 | {.value: 0.0099f, .fmt: chars_format::general, .precision: 1, .correct: "0.01" }, |
524 | {.value: 0.0099f, .fmt: chars_format::general, .precision: 2, .correct: "0.0099" }, |
525 | {.value: 0.0099f, .fmt: chars_format::general, .precision: 3, .correct: "0.0099" }, |
526 | {.value: 0.0099f, .fmt: chars_format::general, .precision: 4, .correct: "0.0099" }, |
527 | {.value: 0.0099f, .fmt: chars_format::general, .precision: 5, .correct: "0.0099" }, |
528 | {.value: 0.0099f, .fmt: chars_format::general, .precision: 6, .correct: "0.0099" }, |
529 | |
530 | {.value: 0.009f, .fmt: chars_format::general, .precision: 1, .correct: "0.009" }, |
531 | {.value: 0.009f, .fmt: chars_format::general, .precision: 2, .correct: "0.009" }, |
532 | {.value: 0.009f, .fmt: chars_format::general, .precision: 3, .correct: "0.009" }, |
533 | {.value: 0.009f, .fmt: chars_format::general, .precision: 4, .correct: "0.009" }, |
534 | {.value: 0.009f, .fmt: chars_format::general, .precision: 5, .correct: "0.009" }, |
535 | {.value: 0.009f, .fmt: chars_format::general, .precision: 6, .correct: "0.009" }, |
536 | |
537 | {.value: 0.000999999f, .fmt: chars_format::general, .precision: 1, .correct: "0.001" }, |
538 | {.value: 0.000999999f, .fmt: chars_format::general, .precision: 2, .correct: "0.001" }, |
539 | {.value: 0.000999999f, .fmt: chars_format::general, .precision: 3, .correct: "0.001" }, |
540 | {.value: 0.000999999f, .fmt: chars_format::general, .precision: 4, .correct: "0.001" }, |
541 | {.value: 0.000999999f, .fmt: chars_format::general, .precision: 5, .correct: "0.001" }, |
542 | {.value: 0.000999999f, .fmt: chars_format::general, .precision: 6, .correct: "0.000999999" }, |
543 | |
544 | {.value: 0.00099999f, .fmt: chars_format::general, .precision: 1, .correct: "0.001" }, |
545 | {.value: 0.00099999f, .fmt: chars_format::general, .precision: 2, .correct: "0.001" }, |
546 | {.value: 0.00099999f, .fmt: chars_format::general, .precision: 3, .correct: "0.001" }, |
547 | {.value: 0.00099999f, .fmt: chars_format::general, .precision: 4, .correct: "0.001" }, |
548 | {.value: 0.00099999f, .fmt: chars_format::general, .precision: 5, .correct: "0.00099999" }, |
549 | {.value: 0.00099999f, .fmt: chars_format::general, .precision: 6, .correct: "0.00099999" }, |
550 | |
551 | {.value: 0.0009999f, .fmt: chars_format::general, .precision: 1, .correct: "0.001" }, |
552 | {.value: 0.0009999f, .fmt: chars_format::general, .precision: 2, .correct: "0.001" }, |
553 | {.value: 0.0009999f, .fmt: chars_format::general, .precision: 3, .correct: "0.001" }, |
554 | {.value: 0.0009999f, .fmt: chars_format::general, .precision: 4, .correct: "0.0009999" }, |
555 | {.value: 0.0009999f, .fmt: chars_format::general, .precision: 5, .correct: "0.0009999" }, |
556 | {.value: 0.0009999f, .fmt: chars_format::general, .precision: 6, .correct: "0.0009999" }, |
557 | |
558 | {.value: 0.000999f, .fmt: chars_format::general, .precision: 1, .correct: "0.001" }, |
559 | {.value: 0.000999f, .fmt: chars_format::general, .precision: 2, .correct: "0.001" }, |
560 | {.value: 0.000999f, .fmt: chars_format::general, .precision: 3, .correct: "0.000999" }, |
561 | {.value: 0.000999f, .fmt: chars_format::general, .precision: 4, .correct: "0.000999" }, |
562 | {.value: 0.000999f, .fmt: chars_format::general, .precision: 5, .correct: "0.000999" }, |
563 | {.value: 0.000999f, .fmt: chars_format::general, .precision: 6, .correct: "0.000999" }, |
564 | |
565 | {.value: 0.00099f, .fmt: chars_format::general, .precision: 1, .correct: "0.001" }, |
566 | {.value: 0.00099f, .fmt: chars_format::general, .precision: 2, .correct: "0.00099" }, |
567 | {.value: 0.00099f, .fmt: chars_format::general, .precision: 3, .correct: "0.00099" }, |
568 | {.value: 0.00099f, .fmt: chars_format::general, .precision: 4, .correct: "0.00099" }, |
569 | {.value: 0.00099f, .fmt: chars_format::general, .precision: 5, .correct: "0.00099" }, |
570 | {.value: 0.00099f, .fmt: chars_format::general, .precision: 6, .correct: "0.00099" }, |
571 | |
572 | {.value: 0.0009f, .fmt: chars_format::general, .precision: 1, .correct: "0.0009" }, |
573 | {.value: 0.0009f, .fmt: chars_format::general, .precision: 2, .correct: "0.0009" }, |
574 | {.value: 0.0009f, .fmt: chars_format::general, .precision: 3, .correct: "0.0009" }, |
575 | {.value: 0.0009f, .fmt: chars_format::general, .precision: 4, .correct: "0.0009" }, |
576 | {.value: 0.0009f, .fmt: chars_format::general, .precision: 5, .correct: "0.0009" }, |
577 | {.value: 0.0009f, .fmt: chars_format::general, .precision: 6, .correct: "0.0009" }, |
578 | |
579 | // Having a scientific exponent X == -5 triggers scientific notation. |
580 | // If rounding adjusts this to X == -4, then fixed notation will be selected. |
581 | {.value: 0.0000999999f, .fmt: chars_format::general, .precision: 1, .correct: "0.0001" }, |
582 | {.value: 0.0000999999f, .fmt: chars_format::general, .precision: 2, .correct: "0.0001" }, |
583 | {.value: 0.0000999999f, .fmt: chars_format::general, .precision: 3, .correct: "0.0001" }, |
584 | {.value: 0.0000999999f, .fmt: chars_format::general, .precision: 4, .correct: "0.0001" }, |
585 | {.value: 0.0000999999f, .fmt: chars_format::general, .precision: 5, .correct: "0.0001" }, |
586 | {.value: 0.0000999999f, .fmt: chars_format::general, .precision: 6, .correct: "9.99999e-05" }, |
587 | |
588 | {.value: 0.000099999f, .fmt: chars_format::general, .precision: 1, .correct: "0.0001" }, |
589 | {.value: 0.000099999f, .fmt: chars_format::general, .precision: 2, .correct: "0.0001" }, |
590 | {.value: 0.000099999f, .fmt: chars_format::general, .precision: 3, .correct: "0.0001" }, |
591 | {.value: 0.000099999f, .fmt: chars_format::general, .precision: 4, .correct: "0.0001" }, |
592 | {.value: 0.000099999f, .fmt: chars_format::general, .precision: 5, .correct: "9.9999e-05" }, |
593 | {.value: 0.000099999f, .fmt: chars_format::general, .precision: 6, .correct: "9.9999e-05" }, |
594 | |
595 | {.value: 0.00009999f, .fmt: chars_format::general, .precision: 1, .correct: "0.0001" }, |
596 | {.value: 0.00009999f, .fmt: chars_format::general, .precision: 2, .correct: "0.0001" }, |
597 | {.value: 0.00009999f, .fmt: chars_format::general, .precision: 3, .correct: "0.0001" }, |
598 | {.value: 0.00009999f, .fmt: chars_format::general, .precision: 4, .correct: "9.999e-05" }, |
599 | {.value: 0.00009999f, .fmt: chars_format::general, .precision: 5, .correct: "9.999e-05" }, |
600 | {.value: 0.00009999f, .fmt: chars_format::general, .precision: 6, .correct: "9.999e-05" }, |
601 | |
602 | {.value: 0.0000999f, .fmt: chars_format::general, .precision: 1, .correct: "0.0001" }, |
603 | {.value: 0.0000999f, .fmt: chars_format::general, .precision: 2, .correct: "0.0001" }, |
604 | {.value: 0.0000999f, .fmt: chars_format::general, .precision: 3, .correct: "9.99e-05" }, |
605 | {.value: 0.0000999f, .fmt: chars_format::general, .precision: 4, .correct: "9.99e-05" }, |
606 | {.value: 0.0000999f, .fmt: chars_format::general, .precision: 5, .correct: "9.99e-05" }, |
607 | {.value: 0.0000999f, .fmt: chars_format::general, .precision: 6, .correct: "9.99e-05" }, |
608 | |
609 | {.value: 0.000099f, .fmt: chars_format::general, .precision: 1, .correct: "0.0001" }, |
610 | {.value: 0.000099f, .fmt: chars_format::general, .precision: 2, .correct: "9.9e-05" }, |
611 | {.value: 0.000099f, .fmt: chars_format::general, .precision: 3, .correct: "9.9e-05" }, |
612 | {.value: 0.000099f, .fmt: chars_format::general, .precision: 4, .correct: "9.9e-05" }, |
613 | {.value: 0.000099f, .fmt: chars_format::general, .precision: 5, .correct: "9.9e-05" }, |
614 | {.value: 0.000099f, .fmt: chars_format::general, .precision: 6, .correct: "9.9e-05" }, |
615 | |
616 | {.value: 0.00009f, .fmt: chars_format::general, .precision: 1, .correct: "9e-05" }, |
617 | {.value: 0.00009f, .fmt: chars_format::general, .precision: 2, .correct: "9e-05" }, |
618 | {.value: 0.00009f, .fmt: chars_format::general, .precision: 3, .correct: "9e-05" }, |
619 | {.value: 0.00009f, .fmt: chars_format::general, .precision: 4, .correct: "9e-05" }, |
620 | {.value: 0.00009f, .fmt: chars_format::general, .precision: 5, .correct: "9e-05" }, |
621 | {.value: 0.00009f, .fmt: chars_format::general, .precision: 6, .correct: "9e-05" }, |
622 | |
623 | // Rounding test cases without exponent-adjusting behavior. |
624 | {.value: 2999.999f, .fmt: chars_format::general, .precision: 1, .correct: "3e+03" }, |
625 | {.value: 2999.999f, .fmt: chars_format::general, .precision: 2, .correct: "3e+03" }, |
626 | {.value: 2999.999f, .fmt: chars_format::general, .precision: 3, .correct: "3e+03" }, |
627 | {.value: 2999.999f, .fmt: chars_format::general, .precision: 4, .correct: "3000" }, |
628 | {.value: 2999.999f, .fmt: chars_format::general, .precision: 5, .correct: "3000" }, |
629 | {.value: 2999.999f, .fmt: chars_format::general, .precision: 6, .correct: "3000" }, |
630 | |
631 | {.value: 2999.99f, .fmt: chars_format::general, .precision: 1, .correct: "3e+03" }, |
632 | {.value: 2999.99f, .fmt: chars_format::general, .precision: 2, .correct: "3e+03" }, |
633 | {.value: 2999.99f, .fmt: chars_format::general, .precision: 3, .correct: "3e+03" }, |
634 | {.value: 2999.99f, .fmt: chars_format::general, .precision: 4, .correct: "3000" }, |
635 | {.value: 2999.99f, .fmt: chars_format::general, .precision: 5, .correct: "3000" }, |
636 | {.value: 2999.99f, .fmt: chars_format::general, .precision: 6, .correct: "2999.99" }, |
637 | |
638 | {.value: 2999.9f, .fmt: chars_format::general, .precision: 1, .correct: "3e+03" }, |
639 | {.value: 2999.9f, .fmt: chars_format::general, .precision: 2, .correct: "3e+03" }, |
640 | {.value: 2999.9f, .fmt: chars_format::general, .precision: 3, .correct: "3e+03" }, |
641 | {.value: 2999.9f, .fmt: chars_format::general, .precision: 4, .correct: "3000" }, |
642 | {.value: 2999.9f, .fmt: chars_format::general, .precision: 5, .correct: "2999.9" }, |
643 | {.value: 2999.9f, .fmt: chars_format::general, .precision: 6, .correct: "2999.9" }, |
644 | |
645 | {.value: 2999.0f, .fmt: chars_format::general, .precision: 1, .correct: "3e+03" }, |
646 | {.value: 2999.0f, .fmt: chars_format::general, .precision: 2, .correct: "3e+03" }, |
647 | {.value: 2999.0f, .fmt: chars_format::general, .precision: 3, .correct: "3e+03" }, |
648 | {.value: 2999.0f, .fmt: chars_format::general, .precision: 4, .correct: "2999" }, |
649 | {.value: 2999.0f, .fmt: chars_format::general, .precision: 5, .correct: "2999" }, |
650 | {.value: 2999.0f, .fmt: chars_format::general, .precision: 6, .correct: "2999" }, |
651 | |
652 | {.value: 299.999f, .fmt: chars_format::general, .precision: 1, .correct: "3e+02" }, |
653 | {.value: 299.999f, .fmt: chars_format::general, .precision: 2, .correct: "3e+02" }, |
654 | {.value: 299.999f, .fmt: chars_format::general, .precision: 3, .correct: "300" }, |
655 | {.value: 299.999f, .fmt: chars_format::general, .precision: 4, .correct: "300" }, |
656 | {.value: 299.999f, .fmt: chars_format::general, .precision: 5, .correct: "300" }, |
657 | {.value: 299.999f, .fmt: chars_format::general, .precision: 6, .correct: "299.999" }, |
658 | |
659 | {.value: 299.99f, .fmt: chars_format::general, .precision: 1, .correct: "3e+02" }, |
660 | {.value: 299.99f, .fmt: chars_format::general, .precision: 2, .correct: "3e+02" }, |
661 | {.value: 299.99f, .fmt: chars_format::general, .precision: 3, .correct: "300" }, |
662 | {.value: 299.99f, .fmt: chars_format::general, .precision: 4, .correct: "300" }, |
663 | {.value: 299.99f, .fmt: chars_format::general, .precision: 5, .correct: "299.99" }, |
664 | {.value: 299.99f, .fmt: chars_format::general, .precision: 6, .correct: "299.99" }, |
665 | |
666 | {.value: 299.9f, .fmt: chars_format::general, .precision: 1, .correct: "3e+02" }, |
667 | {.value: 299.9f, .fmt: chars_format::general, .precision: 2, .correct: "3e+02" }, |
668 | {.value: 299.9f, .fmt: chars_format::general, .precision: 3, .correct: "300" }, |
669 | {.value: 299.9f, .fmt: chars_format::general, .precision: 4, .correct: "299.9" }, |
670 | {.value: 299.9f, .fmt: chars_format::general, .precision: 5, .correct: "299.9" }, |
671 | {.value: 299.9f, .fmt: chars_format::general, .precision: 6, .correct: "299.9" }, |
672 | |
673 | {.value: 299.0f, .fmt: chars_format::general, .precision: 1, .correct: "3e+02" }, |
674 | {.value: 299.0f, .fmt: chars_format::general, .precision: 2, .correct: "3e+02" }, |
675 | {.value: 299.0f, .fmt: chars_format::general, .precision: 3, .correct: "299" }, |
676 | {.value: 299.0f, .fmt: chars_format::general, .precision: 4, .correct: "299" }, |
677 | {.value: 299.0f, .fmt: chars_format::general, .precision: 5, .correct: "299" }, |
678 | {.value: 299.0f, .fmt: chars_format::general, .precision: 6, .correct: "299" }, |
679 | |
680 | {.value: 29.999f, .fmt: chars_format::general, .precision: 1, .correct: "3e+01" }, |
681 | {.value: 29.999f, .fmt: chars_format::general, .precision: 2, .correct: "30" }, |
682 | {.value: 29.999f, .fmt: chars_format::general, .precision: 3, .correct: "30" }, |
683 | {.value: 29.999f, .fmt: chars_format::general, .precision: 4, .correct: "30" }, |
684 | {.value: 29.999f, .fmt: chars_format::general, .precision: 5, .correct: "29.999" }, |
685 | {.value: 29.999f, .fmt: chars_format::general, .precision: 6, .correct: "29.999" }, |
686 | |
687 | {.value: 29.99f, .fmt: chars_format::general, .precision: 1, .correct: "3e+01" }, |
688 | {.value: 29.99f, .fmt: chars_format::general, .precision: 2, .correct: "30" }, |
689 | {.value: 29.99f, .fmt: chars_format::general, .precision: 3, .correct: "30" }, |
690 | {.value: 29.99f, .fmt: chars_format::general, .precision: 4, .correct: "29.99" }, |
691 | {.value: 29.99f, .fmt: chars_format::general, .precision: 5, .correct: "29.99" }, |
692 | {.value: 29.99f, .fmt: chars_format::general, .precision: 6, .correct: "29.99" }, |
693 | |
694 | {.value: 29.9f, .fmt: chars_format::general, .precision: 1, .correct: "3e+01" }, |
695 | {.value: 29.9f, .fmt: chars_format::general, .precision: 2, .correct: "30" }, |
696 | {.value: 29.9f, .fmt: chars_format::general, .precision: 3, .correct: "29.9" }, |
697 | {.value: 29.9f, .fmt: chars_format::general, .precision: 4, .correct: "29.9" }, |
698 | {.value: 29.9f, .fmt: chars_format::general, .precision: 5, .correct: "29.9" }, |
699 | {.value: 29.9f, .fmt: chars_format::general, .precision: 6, .correct: "29.9" }, |
700 | |
701 | {.value: 29.0f, .fmt: chars_format::general, .precision: 1, .correct: "3e+01" }, |
702 | {.value: 29.0f, .fmt: chars_format::general, .precision: 2, .correct: "29" }, |
703 | {.value: 29.0f, .fmt: chars_format::general, .precision: 3, .correct: "29" }, |
704 | {.value: 29.0f, .fmt: chars_format::general, .precision: 4, .correct: "29" }, |
705 | {.value: 29.0f, .fmt: chars_format::general, .precision: 5, .correct: "29" }, |
706 | {.value: 29.0f, .fmt: chars_format::general, .precision: 6, .correct: "29" }, |
707 | |
708 | {.value: 2.999f, .fmt: chars_format::general, .precision: 1, .correct: "3" }, |
709 | {.value: 2.999f, .fmt: chars_format::general, .precision: 2, .correct: "3" }, |
710 | {.value: 2.999f, .fmt: chars_format::general, .precision: 3, .correct: "3" }, |
711 | {.value: 2.999f, .fmt: chars_format::general, .precision: 4, .correct: "2.999" }, |
712 | {.value: 2.999f, .fmt: chars_format::general, .precision: 5, .correct: "2.999" }, |
713 | {.value: 2.999f, .fmt: chars_format::general, .precision: 6, .correct: "2.999" }, |
714 | |
715 | {.value: 2.99f, .fmt: chars_format::general, .precision: 1, .correct: "3" }, |
716 | {.value: 2.99f, .fmt: chars_format::general, .precision: 2, .correct: "3" }, |
717 | {.value: 2.99f, .fmt: chars_format::general, .precision: 3, .correct: "2.99" }, |
718 | {.value: 2.99f, .fmt: chars_format::general, .precision: 4, .correct: "2.99" }, |
719 | {.value: 2.99f, .fmt: chars_format::general, .precision: 5, .correct: "2.99" }, |
720 | {.value: 2.99f, .fmt: chars_format::general, .precision: 6, .correct: "2.99" }, |
721 | |
722 | {.value: 2.9f, .fmt: chars_format::general, .precision: 1, .correct: "3" }, |
723 | {.value: 2.9f, .fmt: chars_format::general, .precision: 2, .correct: "2.9" }, |
724 | {.value: 2.9f, .fmt: chars_format::general, .precision: 3, .correct: "2.9" }, |
725 | {.value: 2.9f, .fmt: chars_format::general, .precision: 4, .correct: "2.9" }, |
726 | {.value: 2.9f, .fmt: chars_format::general, .precision: 5, .correct: "2.9" }, |
727 | {.value: 2.9f, .fmt: chars_format::general, .precision: 6, .correct: "2.9" }, |
728 | |
729 | {.value: 2.0f, .fmt: chars_format::general, .precision: 1, .correct: "2" }, |
730 | {.value: 2.0f, .fmt: chars_format::general, .precision: 2, .correct: "2" }, |
731 | {.value: 2.0f, .fmt: chars_format::general, .precision: 3, .correct: "2" }, |
732 | {.value: 2.0f, .fmt: chars_format::general, .precision: 4, .correct: "2" }, |
733 | {.value: 2.0f, .fmt: chars_format::general, .precision: 5, .correct: "2" }, |
734 | {.value: 2.0f, .fmt: chars_format::general, .precision: 6, .correct: "2" }, |
735 | |
736 | {.value: 0.2999f, .fmt: chars_format::general, .precision: 1, .correct: "0.3" }, |
737 | {.value: 0.2999f, .fmt: chars_format::general, .precision: 2, .correct: "0.3" }, |
738 | {.value: 0.2999f, .fmt: chars_format::general, .precision: 3, .correct: "0.3" }, |
739 | {.value: 0.2999f, .fmt: chars_format::general, .precision: 4, .correct: "0.2999" }, |
740 | {.value: 0.2999f, .fmt: chars_format::general, .precision: 5, .correct: "0.2999" }, |
741 | {.value: 0.2999f, .fmt: chars_format::general, .precision: 6, .correct: "0.2999" }, |
742 | |
743 | {.value: 0.299f, .fmt: chars_format::general, .precision: 1, .correct: "0.3" }, |
744 | {.value: 0.299f, .fmt: chars_format::general, .precision: 2, .correct: "0.3" }, |
745 | {.value: 0.299f, .fmt: chars_format::general, .precision: 3, .correct: "0.299" }, |
746 | {.value: 0.299f, .fmt: chars_format::general, .precision: 4, .correct: "0.299" }, |
747 | {.value: 0.299f, .fmt: chars_format::general, .precision: 5, .correct: "0.299" }, |
748 | {.value: 0.299f, .fmt: chars_format::general, .precision: 6, .correct: "0.299" }, |
749 | |
750 | {.value: 0.29f, .fmt: chars_format::general, .precision: 1, .correct: "0.3" }, |
751 | {.value: 0.29f, .fmt: chars_format::general, .precision: 2, .correct: "0.29" }, |
752 | {.value: 0.29f, .fmt: chars_format::general, .precision: 3, .correct: "0.29" }, |
753 | {.value: 0.29f, .fmt: chars_format::general, .precision: 4, .correct: "0.29" }, |
754 | {.value: 0.29f, .fmt: chars_format::general, .precision: 5, .correct: "0.29" }, |
755 | {.value: 0.29f, .fmt: chars_format::general, .precision: 6, .correct: "0.29" }, |
756 | |
757 | {.value: 0.2f, .fmt: chars_format::general, .precision: 1, .correct: "0.2" }, |
758 | {.value: 0.2f, .fmt: chars_format::general, .precision: 2, .correct: "0.2" }, |
759 | {.value: 0.2f, .fmt: chars_format::general, .precision: 3, .correct: "0.2" }, |
760 | {.value: 0.2f, .fmt: chars_format::general, .precision: 4, .correct: "0.2" }, |
761 | {.value: 0.2f, .fmt: chars_format::general, .precision: 5, .correct: "0.2" }, |
762 | {.value: 0.2f, .fmt: chars_format::general, .precision: 6, .correct: "0.2" }, |
763 | |
764 | {.value: 0.02999f, .fmt: chars_format::general, .precision: 1, .correct: "0.03" }, |
765 | {.value: 0.02999f, .fmt: chars_format::general, .precision: 2, .correct: "0.03" }, |
766 | {.value: 0.02999f, .fmt: chars_format::general, .precision: 3, .correct: "0.03" }, |
767 | {.value: 0.02999f, .fmt: chars_format::general, .precision: 4, .correct: "0.02999" }, |
768 | {.value: 0.02999f, .fmt: chars_format::general, .precision: 5, .correct: "0.02999" }, |
769 | {.value: 0.02999f, .fmt: chars_format::general, .precision: 6, .correct: "0.02999" }, |
770 | |
771 | {.value: 0.0299f, .fmt: chars_format::general, .precision: 1, .correct: "0.03" }, |
772 | {.value: 0.0299f, .fmt: chars_format::general, .precision: 2, .correct: "0.03" }, |
773 | {.value: 0.0299f, .fmt: chars_format::general, .precision: 3, .correct: "0.0299" }, |
774 | {.value: 0.0299f, .fmt: chars_format::general, .precision: 4, .correct: "0.0299" }, |
775 | {.value: 0.0299f, .fmt: chars_format::general, .precision: 5, .correct: "0.0299" }, |
776 | {.value: 0.0299f, .fmt: chars_format::general, .precision: 6, .correct: "0.0299" }, |
777 | |
778 | {.value: 0.029f, .fmt: chars_format::general, .precision: 1, .correct: "0.03" }, |
779 | {.value: 0.029f, .fmt: chars_format::general, .precision: 2, .correct: "0.029" }, |
780 | {.value: 0.029f, .fmt: chars_format::general, .precision: 3, .correct: "0.029" }, |
781 | {.value: 0.029f, .fmt: chars_format::general, .precision: 4, .correct: "0.029" }, |
782 | {.value: 0.029f, .fmt: chars_format::general, .precision: 5, .correct: "0.029" }, |
783 | {.value: 0.029f, .fmt: chars_format::general, .precision: 6, .correct: "0.029" }, |
784 | |
785 | {.value: 0.02f, .fmt: chars_format::general, .precision: 1, .correct: "0.02" }, |
786 | {.value: 0.02f, .fmt: chars_format::general, .precision: 2, .correct: "0.02" }, |
787 | {.value: 0.02f, .fmt: chars_format::general, .precision: 3, .correct: "0.02" }, |
788 | {.value: 0.02f, .fmt: chars_format::general, .precision: 4, .correct: "0.02" }, |
789 | {.value: 0.02f, .fmt: chars_format::general, .precision: 5, .correct: "0.02" }, |
790 | {.value: 0.02f, .fmt: chars_format::general, .precision: 6, .correct: "0.02" }, |
791 | |
792 | {.value: 0.002999f, .fmt: chars_format::general, .precision: 1, .correct: "0.003" }, |
793 | {.value: 0.002999f, .fmt: chars_format::general, .precision: 2, .correct: "0.003" }, |
794 | {.value: 0.002999f, .fmt: chars_format::general, .precision: 3, .correct: "0.003" }, |
795 | {.value: 0.002999f, .fmt: chars_format::general, .precision: 4, .correct: "0.002999" }, |
796 | {.value: 0.002999f, .fmt: chars_format::general, .precision: 5, .correct: "0.002999" }, |
797 | {.value: 0.002999f, .fmt: chars_format::general, .precision: 6, .correct: "0.002999" }, |
798 | |
799 | {.value: 0.00299f, .fmt: chars_format::general, .precision: 1, .correct: "0.003" }, |
800 | {.value: 0.00299f, .fmt: chars_format::general, .precision: 2, .correct: "0.003" }, |
801 | {.value: 0.00299f, .fmt: chars_format::general, .precision: 3, .correct: "0.00299" }, |
802 | {.value: 0.00299f, .fmt: chars_format::general, .precision: 4, .correct: "0.00299" }, |
803 | {.value: 0.00299f, .fmt: chars_format::general, .precision: 5, .correct: "0.00299" }, |
804 | {.value: 0.00299f, .fmt: chars_format::general, .precision: 6, .correct: "0.00299" }, |
805 | |
806 | {.value: 0.0029f, .fmt: chars_format::general, .precision: 1, .correct: "0.003" }, |
807 | {.value: 0.0029f, .fmt: chars_format::general, .precision: 2, .correct: "0.0029" }, |
808 | {.value: 0.0029f, .fmt: chars_format::general, .precision: 3, .correct: "0.0029" }, |
809 | {.value: 0.0029f, .fmt: chars_format::general, .precision: 4, .correct: "0.0029" }, |
810 | {.value: 0.0029f, .fmt: chars_format::general, .precision: 5, .correct: "0.0029" }, |
811 | {.value: 0.0029f, .fmt: chars_format::general, .precision: 6, .correct: "0.0029" }, |
812 | |
813 | {.value: 0.002f, .fmt: chars_format::general, .precision: 1, .correct: "0.002" }, |
814 | {.value: 0.002f, .fmt: chars_format::general, .precision: 2, .correct: "0.002" }, |
815 | {.value: 0.002f, .fmt: chars_format::general, .precision: 3, .correct: "0.002" }, |
816 | {.value: 0.002f, .fmt: chars_format::general, .precision: 4, .correct: "0.002" }, |
817 | {.value: 0.002f, .fmt: chars_format::general, .precision: 5, .correct: "0.002" }, |
818 | {.value: 0.002f, .fmt: chars_format::general, .precision: 6, .correct: "0.002" }, |
819 | |
820 | {.value: 0.0002999f, .fmt: chars_format::general, .precision: 1, .correct: "0.0003" }, |
821 | {.value: 0.0002999f, .fmt: chars_format::general, .precision: 2, .correct: "0.0003" }, |
822 | {.value: 0.0002999f, .fmt: chars_format::general, .precision: 3, .correct: "0.0003" }, |
823 | {.value: 0.0002999f, .fmt: chars_format::general, .precision: 4, .correct: "0.0002999" }, |
824 | {.value: 0.0002999f, .fmt: chars_format::general, .precision: 5, .correct: "0.0002999" }, |
825 | {.value: 0.0002999f, .fmt: chars_format::general, .precision: 6, .correct: "0.0002999" }, |
826 | |
827 | {.value: 0.000299f, .fmt: chars_format::general, .precision: 1, .correct: "0.0003" }, |
828 | {.value: 0.000299f, .fmt: chars_format::general, .precision: 2, .correct: "0.0003" }, |
829 | {.value: 0.000299f, .fmt: chars_format::general, .precision: 3, .correct: "0.000299" }, |
830 | {.value: 0.000299f, .fmt: chars_format::general, .precision: 4, .correct: "0.000299" }, |
831 | {.value: 0.000299f, .fmt: chars_format::general, .precision: 5, .correct: "0.000299" }, |
832 | {.value: 0.000299f, .fmt: chars_format::general, .precision: 6, .correct: "0.000299" }, |
833 | |
834 | {.value: 0.00029f, .fmt: chars_format::general, .precision: 1, .correct: "0.0003" }, |
835 | {.value: 0.00029f, .fmt: chars_format::general, .precision: 2, .correct: "0.00029" }, |
836 | {.value: 0.00029f, .fmt: chars_format::general, .precision: 3, .correct: "0.00029" }, |
837 | {.value: 0.00029f, .fmt: chars_format::general, .precision: 4, .correct: "0.00029" }, |
838 | {.value: 0.00029f, .fmt: chars_format::general, .precision: 5, .correct: "0.00029" }, |
839 | {.value: 0.00029f, .fmt: chars_format::general, .precision: 6, .correct: "0.00029" }, |
840 | |
841 | {.value: 0.0002f, .fmt: chars_format::general, .precision: 1, .correct: "0.0002" }, |
842 | {.value: 0.0002f, .fmt: chars_format::general, .precision: 2, .correct: "0.0002" }, |
843 | {.value: 0.0002f, .fmt: chars_format::general, .precision: 3, .correct: "0.0002" }, |
844 | {.value: 0.0002f, .fmt: chars_format::general, .precision: 4, .correct: "0.0002" }, |
845 | {.value: 0.0002f, .fmt: chars_format::general, .precision: 5, .correct: "0.0002" }, |
846 | {.value: 0.0002f, .fmt: chars_format::general, .precision: 6, .correct: "0.0002" }, |
847 | |
848 | {.value: 0.00002999f, .fmt: chars_format::general, .precision: 1, .correct: "3e-05" }, |
849 | {.value: 0.00002999f, .fmt: chars_format::general, .precision: 2, .correct: "3e-05" }, |
850 | {.value: 0.00002999f, .fmt: chars_format::general, .precision: 3, .correct: "3e-05" }, |
851 | {.value: 0.00002999f, .fmt: chars_format::general, .precision: 4, .correct: "2.999e-05" }, |
852 | {.value: 0.00002999f, .fmt: chars_format::general, .precision: 5, .correct: "2.999e-05" }, |
853 | {.value: 0.00002999f, .fmt: chars_format::general, .precision: 6, .correct: "2.999e-05" }, |
854 | |
855 | {.value: 0.0000299f, .fmt: chars_format::general, .precision: 1, .correct: "3e-05" }, |
856 | {.value: 0.0000299f, .fmt: chars_format::general, .precision: 2, .correct: "3e-05" }, |
857 | {.value: 0.0000299f, .fmt: chars_format::general, .precision: 3, .correct: "2.99e-05" }, |
858 | {.value: 0.0000299f, .fmt: chars_format::general, .precision: 4, .correct: "2.99e-05" }, |
859 | {.value: 0.0000299f, .fmt: chars_format::general, .precision: 5, .correct: "2.99e-05" }, |
860 | {.value: 0.0000299f, .fmt: chars_format::general, .precision: 6, .correct: "2.99e-05" }, |
861 | |
862 | {.value: 0.000029f, .fmt: chars_format::general, .precision: 1, .correct: "3e-05" }, |
863 | {.value: 0.000029f, .fmt: chars_format::general, .precision: 2, .correct: "2.9e-05" }, |
864 | {.value: 0.000029f, .fmt: chars_format::general, .precision: 3, .correct: "2.9e-05" }, |
865 | {.value: 0.000029f, .fmt: chars_format::general, .precision: 4, .correct: "2.9e-05" }, |
866 | {.value: 0.000029f, .fmt: chars_format::general, .precision: 5, .correct: "2.9e-05" }, |
867 | {.value: 0.000029f, .fmt: chars_format::general, .precision: 6, .correct: "2.9e-05" }, |
868 | |
869 | {.value: 0.00002f, .fmt: chars_format::general, .precision: 1, .correct: "2e-05" }, |
870 | {.value: 0.00002f, .fmt: chars_format::general, .precision: 2, .correct: "2e-05" }, |
871 | {.value: 0.00002f, .fmt: chars_format::general, .precision: 3, .correct: "2e-05" }, |
872 | {.value: 0.00002f, .fmt: chars_format::general, .precision: 4, .correct: "2e-05" }, |
873 | {.value: 0.00002f, .fmt: chars_format::general, .precision: 5, .correct: "2e-05" }, |
874 | {.value: 0.00002f, .fmt: chars_format::general, .precision: 6, .correct: "2e-05" }, |
875 | |
876 | // Test the transitions between values of the scientific exponent X. |
877 | // For brevity, we avoid testing all possible combinations of P and X. Instead, we test: |
878 | // * All values of P where some X can be affected by rounding. (For float, this is [1, 7].) |
879 | // * P == 25, which is arbitrary. |
880 | // * P == numeric_limits::max_exponent10 + 1. This selects fixed notation for numeric_limits::max(), |
881 | // so it's the largest interesting value of P. |
882 | // * Finally, we test the transitions around X == P - 1, ensuring that we can recognize every value of X. |
883 | {.value: 0x1.8e7578p-14f, .fmt: chars_format::general, .precision: 1, .correct: "9e-05" }, |
884 | {.value: 0x1.8e757ap-14f, .fmt: chars_format::general, .precision: 1, .correct: "0.0001" }, |
885 | {.value: 0x1.f212d6p-11f, .fmt: chars_format::general, .precision: 1, .correct: "0.0009" }, |
886 | {.value: 0x1.f212d8p-11f, .fmt: chars_format::general, .precision: 1, .correct: "0.001" }, |
887 | {.value: 0x1.374bc6p-7f, .fmt: chars_format::general, .precision: 1, .correct: "0.009" }, |
888 | {.value: 0x1.374bc8p-7f, .fmt: chars_format::general, .precision: 1, .correct: "0.01" }, |
889 | {.value: 0x1.851eb8p-4f, .fmt: chars_format::general, .precision: 1, .correct: "0.09" }, |
890 | {.value: 0x1.851ebap-4f, .fmt: chars_format::general, .precision: 1, .correct: "0.1" }, |
891 | {.value: 0x1.e66666p-1f, .fmt: chars_format::general, .precision: 1, .correct: "0.9" }, |
892 | {.value: 0x1.e66668p-1f, .fmt: chars_format::general, .precision: 1, .correct: "1" }, |
893 | {.value: 0x1.2ffffep+3f, .fmt: chars_format::general, .precision: 1, .correct: "9" }, |
894 | {.value: 0x1.300000p+3f, .fmt: chars_format::general, .precision: 1, .correct: "1e+01" }, |
895 | {.value: 0x1.a1554ep-14f, .fmt: chars_format::general, .precision: 2, .correct: "9.9e-05" }, |
896 | {.value: 0x1.a15550p-14f, .fmt: chars_format::general, .precision: 2, .correct: "0.0001" }, |
897 | {.value: 0x1.04d550p-10f, .fmt: chars_format::general, .precision: 2, .correct: "0.00099" }, |
898 | {.value: 0x1.04d552p-10f, .fmt: chars_format::general, .precision: 2, .correct: "0.001" }, |
899 | {.value: 0x1.460aa6p-7f, .fmt: chars_format::general, .precision: 2, .correct: "0.0099" }, |
900 | {.value: 0x1.460aa8p-7f, .fmt: chars_format::general, .precision: 2, .correct: "0.01" }, |
901 | {.value: 0x1.978d4ep-4f, .fmt: chars_format::general, .precision: 2, .correct: "0.099" }, |
902 | {.value: 0x1.978d50p-4f, .fmt: chars_format::general, .precision: 2, .correct: "0.1" }, |
903 | {.value: 0x1.fd70a2p-1f, .fmt: chars_format::general, .precision: 2, .correct: "0.99" }, |
904 | {.value: 0x1.fd70a4p-1f, .fmt: chars_format::general, .precision: 2, .correct: "1" }, |
905 | {.value: 0x1.3e6666p+3f, .fmt: chars_format::general, .precision: 2, .correct: "9.9" }, |
906 | {.value: 0x1.3e6668p+3f, .fmt: chars_format::general, .precision: 2, .correct: "10" }, |
907 | {.value: 0x1.8dfffep+6f, .fmt: chars_format::general, .precision: 2, .correct: "99" }, |
908 | {.value: 0x1.8e0000p+6f, .fmt: chars_format::general, .precision: 2, .correct: "1e+02" }, |
909 | {.value: 0x1.a3387ep-14f, .fmt: chars_format::general, .precision: 3, .correct: "9.99e-05" }, |
910 | {.value: 0x1.a33880p-14f, .fmt: chars_format::general, .precision: 3, .correct: "0.0001" }, |
911 | {.value: 0x1.06034ep-10f, .fmt: chars_format::general, .precision: 3, .correct: "0.000999" }, |
912 | {.value: 0x1.060350p-10f, .fmt: chars_format::general, .precision: 3, .correct: "0.001" }, |
913 | {.value: 0x1.478422p-7f, .fmt: chars_format::general, .precision: 3, .correct: "0.00999" }, |
914 | {.value: 0x1.478424p-7f, .fmt: chars_format::general, .precision: 3, .correct: "0.01" }, |
915 | {.value: 0x1.99652ap-4f, .fmt: chars_format::general, .precision: 3, .correct: "0.0999" }, |
916 | {.value: 0x1.99652cp-4f, .fmt: chars_format::general, .precision: 3, .correct: "0.1" }, |
917 | {.value: 0x1.ffbe76p-1f, .fmt: chars_format::general, .precision: 3, .correct: "0.999" }, |
918 | {.value: 0x1.ffbe78p-1f, .fmt: chars_format::general, .precision: 3, .correct: "1" }, |
919 | {.value: 0x1.3fd70ap+3f, .fmt: chars_format::general, .precision: 3, .correct: "9.99" }, |
920 | {.value: 0x1.3fd70cp+3f, .fmt: chars_format::general, .precision: 3, .correct: "10" }, |
921 | {.value: 0x1.8fccccp+6f, .fmt: chars_format::general, .precision: 3, .correct: "99.9" }, |
922 | {.value: 0x1.8fcccep+6f, .fmt: chars_format::general, .precision: 3, .correct: "100" }, |
923 | {.value: 0x1.f3bffep+9f, .fmt: chars_format::general, .precision: 3, .correct: "999" }, |
924 | {.value: 0x1.f3c000p+9f, .fmt: chars_format::general, .precision: 3, .correct: "1e+03" }, |
925 | {.value: 0x1.a368d0p-14f, .fmt: chars_format::general, .precision: 4, .correct: "9.999e-05" }, |
926 | {.value: 0x1.a368d2p-14f, .fmt: chars_format::general, .precision: 4, .correct: "0.0001" }, |
927 | {.value: 0x1.062182p-10f, .fmt: chars_format::general, .precision: 4, .correct: "0.0009999" }, |
928 | {.value: 0x1.062184p-10f, .fmt: chars_format::general, .precision: 4, .correct: "0.001" }, |
929 | {.value: 0x1.47a9e2p-7f, .fmt: chars_format::general, .precision: 4, .correct: "0.009999" }, |
930 | {.value: 0x1.47a9e4p-7f, .fmt: chars_format::general, .precision: 4, .correct: "0.01" }, |
931 | {.value: 0x1.99945ap-4f, .fmt: chars_format::general, .precision: 4, .correct: "0.09999" }, |
932 | {.value: 0x1.99945cp-4f, .fmt: chars_format::general, .precision: 4, .correct: "0.1" }, |
933 | {.value: 0x1.fff972p-1f, .fmt: chars_format::general, .precision: 4, .correct: "0.9999" }, |
934 | {.value: 0x1.fff974p-1f, .fmt: chars_format::general, .precision: 4, .correct: "1" }, |
935 | {.value: 0x1.3ffbe6p+3f, .fmt: chars_format::general, .precision: 4, .correct: "9.999" }, |
936 | {.value: 0x1.3ffbe8p+3f, .fmt: chars_format::general, .precision: 4, .correct: "10" }, |
937 | {.value: 0x1.8ffae0p+6f, .fmt: chars_format::general, .precision: 4, .correct: "99.99" }, |
938 | {.value: 0x1.8ffae2p+6f, .fmt: chars_format::general, .precision: 4, .correct: "100" }, |
939 | {.value: 0x1.f3f998p+9f, .fmt: chars_format::general, .precision: 4, .correct: "999.9" }, |
940 | {.value: 0x1.f3f99ap+9f, .fmt: chars_format::general, .precision: 4, .correct: "1000" }, |
941 | {.value: 0x1.387bfep+13f, .fmt: chars_format::general, .precision: 4, .correct: "9999" }, |
942 | {.value: 0x1.387c00p+13f, .fmt: chars_format::general, .precision: 4, .correct: "1e+04" }, |
943 | {.value: 0x1.a36da4p-14f, .fmt: chars_format::general, .precision: 5, .correct: "9.9999e-05" }, |
944 | {.value: 0x1.a36da6p-14f, .fmt: chars_format::general, .precision: 5, .correct: "0.0001" }, |
945 | {.value: 0x1.062486p-10f, .fmt: chars_format::general, .precision: 5, .correct: "0.00099999" }, |
946 | {.value: 0x1.062488p-10f, .fmt: chars_format::general, .precision: 5, .correct: "0.001" }, |
947 | {.value: 0x1.47ada8p-7f, .fmt: chars_format::general, .precision: 5, .correct: "0.0099999" }, |
948 | {.value: 0x1.47adaap-7f, .fmt: chars_format::general, .precision: 5, .correct: "0.01" }, |
949 | {.value: 0x1.999912p-4f, .fmt: chars_format::general, .precision: 5, .correct: "0.099999" }, |
950 | {.value: 0x1.999914p-4f, .fmt: chars_format::general, .precision: 5, .correct: "0.1" }, |
951 | {.value: 0x1.ffff58p-1f, .fmt: chars_format::general, .precision: 5, .correct: "0.99999" }, |
952 | {.value: 0x1.ffff5ap-1f, .fmt: chars_format::general, .precision: 5, .correct: "1" }, |
953 | {.value: 0x1.3fff96p+3f, .fmt: chars_format::general, .precision: 5, .correct: "9.9999" }, |
954 | {.value: 0x1.3fff98p+3f, .fmt: chars_format::general, .precision: 5, .correct: "10" }, |
955 | {.value: 0x1.8fff7cp+6f, .fmt: chars_format::general, .precision: 5, .correct: "99.999" }, |
956 | {.value: 0x1.8fff7ep+6f, .fmt: chars_format::general, .precision: 5, .correct: "100" }, |
957 | {.value: 0x1.f3ff5cp+9f, .fmt: chars_format::general, .precision: 5, .correct: "999.99" }, |
958 | {.value: 0x1.f3ff5ep+9f, .fmt: chars_format::general, .precision: 5, .correct: "1000" }, |
959 | {.value: 0x1.387f98p+13f, .fmt: chars_format::general, .precision: 5, .correct: "9999.9" }, |
960 | {.value: 0x1.387f9ap+13f, .fmt: chars_format::general, .precision: 5, .correct: "10000" }, |
961 | {.value: 0x1.869f7ep+16f, .fmt: chars_format::general, .precision: 5, .correct: "99999" }, |
962 | {.value: 0x1.869f80p+16f, .fmt: chars_format::general, .precision: 5, .correct: "1e+05" }, |
963 | {.value: 0x1.a36e20p-14f, .fmt: chars_format::general, .precision: 6, .correct: "9.99999e-05" }, |
964 | {.value: 0x1.a36e22p-14f, .fmt: chars_format::general, .precision: 6, .correct: "0.0001" }, |
965 | {.value: 0x1.0624d4p-10f, .fmt: chars_format::general, .precision: 6, .correct: "0.000999999" }, |
966 | {.value: 0x1.0624d6p-10f, .fmt: chars_format::general, .precision: 6, .correct: "0.001" }, |
967 | {.value: 0x1.47ae08p-7f, .fmt: chars_format::general, .precision: 6, .correct: "0.00999999" }, |
968 | {.value: 0x1.47ae0ap-7f, .fmt: chars_format::general, .precision: 6, .correct: "0.01" }, |
969 | {.value: 0x1.99998cp-4f, .fmt: chars_format::general, .precision: 6, .correct: "0.0999999" }, |
970 | {.value: 0x1.99998ep-4f, .fmt: chars_format::general, .precision: 6, .correct: "0.1" }, |
971 | {.value: 0x1.ffffeep-1f, .fmt: chars_format::general, .precision: 6, .correct: "0.999999" }, |
972 | {.value: 0x1.fffff0p-1f, .fmt: chars_format::general, .precision: 6, .correct: "1" }, |
973 | {.value: 0x1.3ffff4p+3f, .fmt: chars_format::general, .precision: 6, .correct: "9.99999" }, |
974 | {.value: 0x1.3ffff6p+3f, .fmt: chars_format::general, .precision: 6, .correct: "10" }, |
975 | {.value: 0x1.8ffff2p+6f, .fmt: chars_format::general, .precision: 6, .correct: "99.9999" }, |
976 | {.value: 0x1.8ffff4p+6f, .fmt: chars_format::general, .precision: 6, .correct: "100" }, |
977 | {.value: 0x1.f3ffeep+9f, .fmt: chars_format::general, .precision: 6, .correct: "999.999" }, |
978 | {.value: 0x1.f3fff0p+9f, .fmt: chars_format::general, .precision: 6, .correct: "1000" }, |
979 | {.value: 0x1.387ff4p+13f, .fmt: chars_format::general, .precision: 6, .correct: "9999.99" }, |
980 | {.value: 0x1.387ff6p+13f, .fmt: chars_format::general, .precision: 6, .correct: "10000" }, |
981 | {.value: 0x1.869ff2p+16f, .fmt: chars_format::general, .precision: 6, .correct: "99999.9" }, |
982 | {.value: 0x1.869ff4p+16f, .fmt: chars_format::general, .precision: 6, .correct: "100000" }, |
983 | {.value: 0x1.e847eep+19f, .fmt: chars_format::general, .precision: 6, .correct: "999999" }, |
984 | {.value: 0x1.e847f0p+19f, .fmt: chars_format::general, .precision: 6, .correct: "1e+06" }, |
985 | {.value: 0x1.a36e2cp-14f, .fmt: chars_format::general, .precision: 7, .correct: "9.999999e-05" }, |
986 | {.value: 0x1.a36e2ep-14f, .fmt: chars_format::general, .precision: 7, .correct: "0.0001" }, |
987 | {.value: 0x1.0624dcp-10f, .fmt: chars_format::general, .precision: 7, .correct: "0.0009999999" }, |
988 | {.value: 0x1.0624dep-10f, .fmt: chars_format::general, .precision: 7, .correct: "0.001" }, |
989 | {.value: 0x1.47ae12p-7f, .fmt: chars_format::general, .precision: 7, .correct: "0.009999999" }, |
990 | {.value: 0x1.47ae14p-7f, .fmt: chars_format::general, .precision: 7, .correct: "0.01" }, |
991 | {.value: 0x1.999998p-4f, .fmt: chars_format::general, .precision: 7, .correct: "0.09999999" }, |
992 | {.value: 0x1.99999ap-4f, .fmt: chars_format::general, .precision: 7, .correct: "0.1" }, |
993 | {.value: 0x1.fffffep-1f, .fmt: chars_format::general, .precision: 7, .correct: "0.9999999" }, |
994 | {.value: 0x1.000000p+0f, .fmt: chars_format::general, .precision: 7, .correct: "1" }, |
995 | {.value: 0x1.3ffffep+3f, .fmt: chars_format::general, .precision: 7, .correct: "9.999999" }, |
996 | {.value: 0x1.400000p+3f, .fmt: chars_format::general, .precision: 7, .correct: "10" }, |
997 | {.value: 0x1.8ffffep+6f, .fmt: chars_format::general, .precision: 7, .correct: "99.99999" }, |
998 | {.value: 0x1.900000p+6f, .fmt: chars_format::general, .precision: 7, .correct: "100" }, |
999 | {.value: 0x1.f3fffep+9f, .fmt: chars_format::general, .precision: 7, .correct: "999.9999" }, |
1000 | {.value: 0x1.f40000p+9f, .fmt: chars_format::general, .precision: 7, .correct: "1000" }, |
1001 | {.value: 0x1.387ffep+13f, .fmt: chars_format::general, .precision: 7, .correct: "9999.999" }, |
1002 | {.value: 0x1.388000p+13f, .fmt: chars_format::general, .precision: 7, .correct: "10000" }, |
1003 | {.value: 0x1.869ffep+16f, .fmt: chars_format::general, .precision: 7, .correct: "99999.99" }, |
1004 | {.value: 0x1.86a000p+16f, .fmt: chars_format::general, .precision: 7, .correct: "100000" }, |
1005 | {.value: 0x1.e847fep+19f, .fmt: chars_format::general, .precision: 7, .correct: "999999.9" }, |
1006 | {.value: 0x1.e84800p+19f, .fmt: chars_format::general, .precision: 7, .correct: "1000000" }, |
1007 | {.value: 0x1.312cfep+23f, .fmt: chars_format::general, .precision: 7, .correct: "9999999" }, |
1008 | {.value: 0x1.312d00p+23f, .fmt: chars_format::general, .precision: 7, .correct: "1e+07" }, |
1009 | {.value: 0x1.7d783ep+26f, .fmt: chars_format::general, .precision: 8, .correct: "99999992" }, |
1010 | {.value: 0x1.7d7840p+26f, .fmt: chars_format::general, .precision: 8, .correct: "1e+08" }, |
1011 | {.value: 0x1.dcd64ep+29f, .fmt: chars_format::general, .precision: 9, .correct: "999999936" }, |
1012 | {.value: 0x1.dcd650p+29f, .fmt: chars_format::general, .precision: 9, .correct: "1e+09" }, |
1013 | {.value: 0x1.2a05f0p+33f, .fmt: chars_format::general, .precision: 10, .correct: "9999998976" }, |
1014 | {.value: 0x1.2a05f2p+33f, .fmt: chars_format::general, .precision: 10, .correct: "1e+10" }, |
1015 | {.value: 0x1.74876ep+36f, .fmt: chars_format::general, .precision: 11, .correct: "99999997952" }, |
1016 | {.value: 0x1.748770p+36f, .fmt: chars_format::general, .precision: 11, .correct: "1.0000000614e+11" }, |
1017 | {.value: 0x1.d1a94ap+39f, .fmt: chars_format::general, .precision: 12, .correct: "999999995904" }, |
1018 | {.value: 0x1.d1a94cp+39f, .fmt: chars_format::general, .precision: 12, .correct: "1.00000006144e+12" }, |
1019 | {.value: 0x1.2309cep+43f, .fmt: chars_format::general, .precision: 13, .correct: "9999999827968" }, |
1020 | {.value: 0x1.2309d0p+43f, .fmt: chars_format::general, .precision: 13, .correct: "1.000000087654e+13" }, |
1021 | {.value: 0x1.6bcc40p+46f, .fmt: chars_format::general, .precision: 14, .correct: "99999991988224" }, |
1022 | {.value: 0x1.6bcc42p+46f, .fmt: chars_format::general, .precision: 14, .correct: "1.0000000037683e+14" }, |
1023 | {.value: 0x1.c6bf52p+49f, .fmt: chars_format::general, .precision: 15, .correct: "999999986991104" }, |
1024 | {.value: 0x1.c6bf54p+49f, .fmt: chars_format::general, .precision: 15, .correct: "1.00000005409997e+15" }, |
1025 | {.value: 0x1.1c3792p+53f, .fmt: chars_format::general, .precision: 16, .correct: "9999999198822400" }, |
1026 | {.value: 0x1.1c3794p+53f, .fmt: chars_format::general, .precision: 16, .correct: "1.000000027256422e+16" }, |
1027 | {.value: 0x1.634578p+56f, .fmt: chars_format::general, .precision: 17, .correct: "99999998430674944" }, |
1028 | {.value: 0x1.63457ap+56f, .fmt: chars_format::general, .precision: 17, .correct: "1.0000000702060954e+17" }, |
1029 | {.value: 0x1.bc16d6p+59f, .fmt: chars_format::general, .precision: 18, .correct: "999999984306749440" }, |
1030 | {.value: 0x1.bc16d8p+59f, .fmt: chars_format::general, .precision: 18, .correct: "1.00000005302622618e+18" }, |
1031 | {.value: 0x1.158e46p+63f, .fmt: chars_format::general, .precision: 19, .correct: "9999999980506447872" }, |
1032 | {.value: 0x1.158e48p+63f, .fmt: chars_format::general, .precision: 19, .correct: "1.000000108001807565e+19" }, |
1033 | {.value: 0x1.5af1d6p+66f, .fmt: chars_format::general, .precision: 20, .correct: "99999993207994712064" }, |
1034 | {.value: 0x1.5af1d8p+66f, .fmt: chars_format::general, .precision: 20, .correct: "1.0000000200408773427e+20" }, |
1035 | {.value: 0x1.b1ae4cp+69f, .fmt: chars_format::general, .precision: 21, .correct: "999999949672133165056" }, |
1036 | {.value: 0x1.b1ae4ep+69f, .fmt: chars_format::general, .precision: 21, .correct: "1.00000002004087734272e+21" }, |
1037 | {.value: 0x1.0f0cf0p+73f, .fmt: chars_format::general, .precision: 22, .correct: "9999999778196308361216" }, |
1038 | {.value: 0x1.0f0cf2p+73f, .fmt: chars_format::general, .precision: 22, .correct: "1.000000090409621520384e+22" }, |
1039 | {.value: 0x1.52d02cp+76f, .fmt: chars_format::general, .precision: 23, .correct: "99999997781963083612160" }, |
1040 | {.value: 0x1.52d02ep+76f, .fmt: chars_format::general, .precision: 23, .correct: "1.0000000678916233835315e+23" }, |
1041 | {.value: 0x1.a78436p+79f, .fmt: chars_format::general, .precision: 24, .correct: "999999941790833817157632" }, |
1042 | {.value: 0x1.a78438p+79f, .fmt: chars_format::general, .precision: 24, .correct: "1.00000001384842785508557e+24" }, |
1043 | {.value: 0x1.a36e2ep-14f, .fmt: chars_format::general, .precision: 25, .correct: "9.999999747378751635551453e-05" }, |
1044 | {.value: 0x1.a36e30p-14f, .fmt: chars_format::general, .precision: 25, .correct: "0.0001000000047497451305389404" }, |
1045 | {.value: 0x1.0624dcp-10f, .fmt: chars_format::general, .precision: 25, .correct: "0.0009999999310821294784545898" }, |
1046 | {.value: 0x1.0624dep-10f, .fmt: chars_format::general, .precision: 25, .correct: "0.001000000047497451305389404" }, |
1047 | {.value: 0x1.47ae14p-7f, .fmt: chars_format::general, .precision: 25, .correct: "0.009999999776482582092285156" }, |
1048 | {.value: 0x1.47ae16p-7f, .fmt: chars_format::general, .precision: 25, .correct: "0.01000000070780515670776367" }, |
1049 | {.value: 0x1.999998p-4f, .fmt: chars_format::general, .precision: 25, .correct: "0.0999999940395355224609375" }, |
1050 | {.value: 0x1.99999ap-4f, .fmt: chars_format::general, .precision: 25, .correct: "0.1000000014901161193847656" }, |
1051 | {.value: 0x1.fffffep-1f, .fmt: chars_format::general, .precision: 25, .correct: "0.999999940395355224609375" }, |
1052 | {.value: 0x1.000000p+0f, .fmt: chars_format::general, .precision: 25, .correct: "1" }, |
1053 | {.value: 0x1.3ffffep+3f, .fmt: chars_format::general, .precision: 25, .correct: "9.99999904632568359375" }, |
1054 | {.value: 0x1.400000p+3f, .fmt: chars_format::general, .precision: 25, .correct: "10" }, |
1055 | {.value: 0x1.8ffffep+6f, .fmt: chars_format::general, .precision: 25, .correct: "99.99999237060546875" }, |
1056 | {.value: 0x1.900000p+6f, .fmt: chars_format::general, .precision: 25, .correct: "100" }, |
1057 | {.value: 0x1.f3fffep+9f, .fmt: chars_format::general, .precision: 25, .correct: "999.99993896484375" }, |
1058 | {.value: 0x1.f40000p+9f, .fmt: chars_format::general, .precision: 25, .correct: "1000" }, |
1059 | {.value: 0x1.387ffep+13f, .fmt: chars_format::general, .precision: 25, .correct: "9999.9990234375" }, |
1060 | {.value: 0x1.388000p+13f, .fmt: chars_format::general, .precision: 25, .correct: "10000" }, |
1061 | {.value: 0x1.869ffep+16f, .fmt: chars_format::general, .precision: 25, .correct: "99999.9921875" }, |
1062 | {.value: 0x1.86a000p+16f, .fmt: chars_format::general, .precision: 25, .correct: "100000" }, |
1063 | {.value: 0x1.e847fep+19f, .fmt: chars_format::general, .precision: 25, .correct: "999999.9375" }, |
1064 | {.value: 0x1.e84800p+19f, .fmt: chars_format::general, .precision: 25, .correct: "1000000" }, |
1065 | {.value: 0x1.312cfep+23f, .fmt: chars_format::general, .precision: 25, .correct: "9999999" }, |
1066 | {.value: 0x1.312d00p+23f, .fmt: chars_format::general, .precision: 25, .correct: "10000000" }, |
1067 | {.value: 0x1.7d783ep+26f, .fmt: chars_format::general, .precision: 25, .correct: "99999992" }, |
1068 | {.value: 0x1.7d7840p+26f, .fmt: chars_format::general, .precision: 25, .correct: "100000000" }, |
1069 | {.value: 0x1.dcd64ep+29f, .fmt: chars_format::general, .precision: 25, .correct: "999999936" }, |
1070 | {.value: 0x1.dcd650p+29f, .fmt: chars_format::general, .precision: 25, .correct: "1000000000" }, |
1071 | {.value: 0x1.2a05f0p+33f, .fmt: chars_format::general, .precision: 25, .correct: "9999998976" }, |
1072 | {.value: 0x1.2a05f2p+33f, .fmt: chars_format::general, .precision: 25, .correct: "10000000000" }, |
1073 | {.value: 0x1.74876ep+36f, .fmt: chars_format::general, .precision: 25, .correct: "99999997952" }, |
1074 | {.value: 0x1.748770p+36f, .fmt: chars_format::general, .precision: 25, .correct: "100000006144" }, |
1075 | {.value: 0x1.d1a94ap+39f, .fmt: chars_format::general, .precision: 25, .correct: "999999995904" }, |
1076 | {.value: 0x1.d1a94cp+39f, .fmt: chars_format::general, .precision: 25, .correct: "1000000061440" }, |
1077 | {.value: 0x1.2309cep+43f, .fmt: chars_format::general, .precision: 25, .correct: "9999999827968" }, |
1078 | {.value: 0x1.2309d0p+43f, .fmt: chars_format::general, .precision: 25, .correct: "10000000876544" }, |
1079 | {.value: 0x1.6bcc40p+46f, .fmt: chars_format::general, .precision: 25, .correct: "99999991988224" }, |
1080 | {.value: 0x1.6bcc42p+46f, .fmt: chars_format::general, .precision: 25, .correct: "100000000376832" }, |
1081 | {.value: 0x1.c6bf52p+49f, .fmt: chars_format::general, .precision: 25, .correct: "999999986991104" }, |
1082 | {.value: 0x1.c6bf54p+49f, .fmt: chars_format::general, .precision: 25, .correct: "1000000054099968" }, |
1083 | {.value: 0x1.1c3792p+53f, .fmt: chars_format::general, .precision: 25, .correct: "9999999198822400" }, |
1084 | {.value: 0x1.1c3794p+53f, .fmt: chars_format::general, .precision: 25, .correct: "10000000272564224" }, |
1085 | {.value: 0x1.634578p+56f, .fmt: chars_format::general, .precision: 25, .correct: "99999998430674944" }, |
1086 | {.value: 0x1.63457ap+56f, .fmt: chars_format::general, .precision: 25, .correct: "100000007020609536" }, |
1087 | {.value: 0x1.bc16d6p+59f, .fmt: chars_format::general, .precision: 25, .correct: "999999984306749440" }, |
1088 | {.value: 0x1.bc16d8p+59f, .fmt: chars_format::general, .precision: 25, .correct: "1000000053026226176" }, |
1089 | {.value: 0x1.158e46p+63f, .fmt: chars_format::general, .precision: 25, .correct: "9999999980506447872" }, |
1090 | {.value: 0x1.158e48p+63f, .fmt: chars_format::general, .precision: 25, .correct: "10000001080018075648" }, |
1091 | {.value: 0x1.5af1d6p+66f, .fmt: chars_format::general, .precision: 25, .correct: "99999993207994712064" }, |
1092 | {.value: 0x1.5af1d8p+66f, .fmt: chars_format::general, .precision: 25, .correct: "100000002004087734272" }, |
1093 | {.value: 0x1.b1ae4cp+69f, .fmt: chars_format::general, .precision: 25, .correct: "999999949672133165056" }, |
1094 | {.value: 0x1.b1ae4ep+69f, .fmt: chars_format::general, .precision: 25, .correct: "1000000020040877342720" }, |
1095 | {.value: 0x1.0f0cf0p+73f, .fmt: chars_format::general, .precision: 25, .correct: "9999999778196308361216" }, |
1096 | {.value: 0x1.0f0cf2p+73f, .fmt: chars_format::general, .precision: 25, .correct: "10000000904096215203840" }, |
1097 | {.value: 0x1.52d02cp+76f, .fmt: chars_format::general, .precision: 25, .correct: "99999997781963083612160" }, |
1098 | {.value: 0x1.52d02ep+76f, .fmt: chars_format::general, .precision: 25, .correct: "100000006789162338353152" }, |
1099 | {.value: 0x1.a78436p+79f, .fmt: chars_format::general, .precision: 25, .correct: "999999941790833817157632" }, |
1100 | {.value: 0x1.a78438p+79f, .fmt: chars_format::general, .precision: 25, .correct: "1000000013848427855085568" }, |
1101 | {.value: 0x1.08b2a2p+83f, .fmt: chars_format::general, .precision: 25, .correct: "9999999562023526247432192" }, |
1102 | {.value: 0x1.08b2a4p+83f, .fmt: chars_format::general, .precision: 25, .correct: "1.000000071494503085427917e+25" }, |
1103 | {.value: 0x1.4adf4ap+86f, .fmt: chars_format::general, .precision: 26, .correct: "99999993314392253260627968" }, |
1104 | {.value: 0x1.4adf4cp+86f, .fmt: chars_format::general, .precision: 26, .correct: "1.0000000253776429011540378e+26" }, |
1105 | {.value: 0x1.9d971ep+89f, .fmt: chars_format::general, .precision: 27, .correct: "999999988484154753734934528" }, |
1106 | {.value: 0x1.9d9720p+89f, .fmt: chars_format::general, .precision: 27, .correct: "1.00000006227113104857314099e+27" }, |
1107 | {.value: 0x1.027e72p+93f, .fmt: chars_format::general, .precision: 28, .correct: "9999999442119689768320106496" }, |
1108 | {.value: 0x1.027e74p+93f, .fmt: chars_format::general, .precision: 28, .correct: "1.000000062271131048573140992e+28" }, |
1109 | {.value: 0x1.431e0ep+96f, .fmt: chars_format::general, .precision: 29, .correct: "99999992060013656248378458112" }, |
1110 | {.value: 0x1.431e10p+96f, .fmt: chars_format::general, .precision: 29, .correct: "1.000000015047466219876688855e+29" }, |
1111 | {.value: 0x1.93e592p+99f, .fmt: chars_format::general, .precision: 30, .correct: "999999939489602493962365435904" }, |
1112 | {.value: 0x1.93e594p+99f, .fmt: chars_format::general, .precision: 30, .correct: "1.00000001504746621987668885504e+30" }, |
1113 | {.value: 0x1.f8def8p+102f, .fmt: chars_format::general, .precision: 31, .correct: "9999999848243207295109594873856" }, |
1114 | {.value: 0x1.f8defap+102f, .fmt: chars_format::general, .precision: 31, .correct: "1.000000045270611710242418222694e+31" }, |
1115 | {.value: 0x1.3b8b5ap+106f, .fmt: chars_format::general, .precision: 32, .correct: "99999993646728794492579249913856" }, |
1116 | {.value: 0x1.3b8b5cp+106f, .fmt: chars_format::general, .precision: 32, .correct: "1.0000000331813535140961264756326e+32" }, |
1117 | {.value: 0x1.8a6e32p+109f, .fmt: chars_format::general, .precision: 33, .correct: "999999994495727286427992885035008" }, |
1118 | {.value: 0x1.8a6e34p+109f, .fmt: chars_format::general, .precision: 33, .correct: "1.00000007186697974176426006623027e+33" }, |
1119 | {.value: 0x1.ed09bep+112f, .fmt: chars_format::general, .precision: 34, .correct: "9999999790214767953607394487959552" }, |
1120 | {.value: 0x1.ed09c0p+112f, .fmt: chars_format::general, .precision: 34, .correct: "1.000000040918478759629753193752166e+34" }, |
1121 | {.value: 0x1.342616p+116f, .fmt: chars_format::general, .precision: 35, .correct: "99999994188327561679933120182222848" }, |
1122 | {.value: 0x1.342618p+116f, .fmt: chars_format::general, .precision: 35, .correct: "1.0000000409184787596297531937521664e+35" }, |
1123 | {.value: 0x1.812f9cp+119f, .fmt: chars_format::general, .precision: 36, .correct: "999999961690316245365415600208216064" }, |
1124 | {.value: 0x1.812f9ep+119f, .fmt: chars_format::general, .precision: 36, .correct: "1.0000000409184787596297531937521664e+36" }, |
1125 | {.value: 0x1.e17b84p+122f, .fmt: chars_format::general, .precision: 37, .correct: "9999999933815812510711506376257961984" }, |
1126 | {.value: 0x1.e17b86p+122f, .fmt: chars_format::general, .precision: 37, .correct: "1.000000056764111262482620712460956467e+37" }, |
1127 | {.value: 0x1.2ced32p+126f, .fmt: chars_format::general, .precision: 38, .correct: "99999996802856924650656260769173209088" }, |
1128 | {.value: 0x1.2ced34p+126f, .fmt: chars_format::general, .precision: 38, .correct: "1.000000069440617264764914727427988521e+38" }, |
1129 | {.value: 0x1.a36e2ep-14f, .fmt: chars_format::general, .precision: 39, .correct: "9.99999974737875163555145263671875e-05" }, |
1130 | {.value: 0x1.a36e30p-14f, .fmt: chars_format::general, .precision: 39, .correct: "0.0001000000047497451305389404296875" }, |
1131 | {.value: 0x1.0624dcp-10f, .fmt: chars_format::general, .precision: 39, .correct: "0.00099999993108212947845458984375" }, |
1132 | {.value: 0x1.0624dep-10f, .fmt: chars_format::general, .precision: 39, .correct: "0.001000000047497451305389404296875" }, |
1133 | {.value: 0x1.47ae14p-7f, .fmt: chars_format::general, .precision: 39, .correct: "0.00999999977648258209228515625" }, |
1134 | {.value: 0x1.47ae16p-7f, .fmt: chars_format::general, .precision: 39, .correct: "0.010000000707805156707763671875" }, |
1135 | {.value: 0x1.999998p-4f, .fmt: chars_format::general, .precision: 39, .correct: "0.0999999940395355224609375" }, |
1136 | {.value: 0x1.99999ap-4f, .fmt: chars_format::general, .precision: 39, .correct: "0.100000001490116119384765625" }, |
1137 | {.value: 0x1.fffffep-1f, .fmt: chars_format::general, .precision: 39, .correct: "0.999999940395355224609375" }, |
1138 | {.value: 0x1.000000p+0f, .fmt: chars_format::general, .precision: 39, .correct: "1" }, |
1139 | {.value: 0x1.3ffffep+3f, .fmt: chars_format::general, .precision: 39, .correct: "9.99999904632568359375" }, |
1140 | {.value: 0x1.400000p+3f, .fmt: chars_format::general, .precision: 39, .correct: "10" }, |
1141 | {.value: 0x1.8ffffep+6f, .fmt: chars_format::general, .precision: 39, .correct: "99.99999237060546875" }, |
1142 | {.value: 0x1.900000p+6f, .fmt: chars_format::general, .precision: 39, .correct: "100" }, |
1143 | {.value: 0x1.f3fffep+9f, .fmt: chars_format::general, .precision: 39, .correct: "999.99993896484375" }, |
1144 | {.value: 0x1.f40000p+9f, .fmt: chars_format::general, .precision: 39, .correct: "1000" }, |
1145 | {.value: 0x1.387ffep+13f, .fmt: chars_format::general, .precision: 39, .correct: "9999.9990234375" }, |
1146 | {.value: 0x1.388000p+13f, .fmt: chars_format::general, .precision: 39, .correct: "10000" }, |
1147 | {.value: 0x1.869ffep+16f, .fmt: chars_format::general, .precision: 39, .correct: "99999.9921875" }, |
1148 | {.value: 0x1.86a000p+16f, .fmt: chars_format::general, .precision: 39, .correct: "100000" }, |
1149 | {.value: 0x1.e847fep+19f, .fmt: chars_format::general, .precision: 39, .correct: "999999.9375" }, |
1150 | {.value: 0x1.e84800p+19f, .fmt: chars_format::general, .precision: 39, .correct: "1000000" }, |
1151 | {.value: 0x1.312cfep+23f, .fmt: chars_format::general, .precision: 39, .correct: "9999999" }, |
1152 | {.value: 0x1.312d00p+23f, .fmt: chars_format::general, .precision: 39, .correct: "10000000" }, |
1153 | {.value: 0x1.7d783ep+26f, .fmt: chars_format::general, .precision: 39, .correct: "99999992" }, |
1154 | {.value: 0x1.7d7840p+26f, .fmt: chars_format::general, .precision: 39, .correct: "100000000" }, |
1155 | {.value: 0x1.dcd64ep+29f, .fmt: chars_format::general, .precision: 39, .correct: "999999936" }, |
1156 | {.value: 0x1.dcd650p+29f, .fmt: chars_format::general, .precision: 39, .correct: "1000000000" }, |
1157 | {.value: 0x1.2a05f0p+33f, .fmt: chars_format::general, .precision: 39, .correct: "9999998976" }, |
1158 | {.value: 0x1.2a05f2p+33f, .fmt: chars_format::general, .precision: 39, .correct: "10000000000" }, |
1159 | {.value: 0x1.74876ep+36f, .fmt: chars_format::general, .precision: 39, .correct: "99999997952" }, |
1160 | {.value: 0x1.748770p+36f, .fmt: chars_format::general, .precision: 39, .correct: "100000006144" }, |
1161 | {.value: 0x1.d1a94ap+39f, .fmt: chars_format::general, .precision: 39, .correct: "999999995904" }, |
1162 | {.value: 0x1.d1a94cp+39f, .fmt: chars_format::general, .precision: 39, .correct: "1000000061440" }, |
1163 | {.value: 0x1.2309cep+43f, .fmt: chars_format::general, .precision: 39, .correct: "9999999827968" }, |
1164 | {.value: 0x1.2309d0p+43f, .fmt: chars_format::general, .precision: 39, .correct: "10000000876544" }, |
1165 | {.value: 0x1.6bcc40p+46f, .fmt: chars_format::general, .precision: 39, .correct: "99999991988224" }, |
1166 | {.value: 0x1.6bcc42p+46f, .fmt: chars_format::general, .precision: 39, .correct: "100000000376832" }, |
1167 | {.value: 0x1.c6bf52p+49f, .fmt: chars_format::general, .precision: 39, .correct: "999999986991104" }, |
1168 | {.value: 0x1.c6bf54p+49f, .fmt: chars_format::general, .precision: 39, .correct: "1000000054099968" }, |
1169 | {.value: 0x1.1c3792p+53f, .fmt: chars_format::general, .precision: 39, .correct: "9999999198822400" }, |
1170 | {.value: 0x1.1c3794p+53f, .fmt: chars_format::general, .precision: 39, .correct: "10000000272564224" }, |
1171 | {.value: 0x1.634578p+56f, .fmt: chars_format::general, .precision: 39, .correct: "99999998430674944" }, |
1172 | {.value: 0x1.63457ap+56f, .fmt: chars_format::general, .precision: 39, .correct: "100000007020609536" }, |
1173 | {.value: 0x1.bc16d6p+59f, .fmt: chars_format::general, .precision: 39, .correct: "999999984306749440" }, |
1174 | {.value: 0x1.bc16d8p+59f, .fmt: chars_format::general, .precision: 39, .correct: "1000000053026226176" }, |
1175 | {.value: 0x1.158e46p+63f, .fmt: chars_format::general, .precision: 39, .correct: "9999999980506447872" }, |
1176 | {.value: 0x1.158e48p+63f, .fmt: chars_format::general, .precision: 39, .correct: "10000001080018075648" }, |
1177 | {.value: 0x1.5af1d6p+66f, .fmt: chars_format::general, .precision: 39, .correct: "99999993207994712064" }, |
1178 | {.value: 0x1.5af1d8p+66f, .fmt: chars_format::general, .precision: 39, .correct: "100000002004087734272" }, |
1179 | {.value: 0x1.b1ae4cp+69f, .fmt: chars_format::general, .precision: 39, .correct: "999999949672133165056" }, |
1180 | {.value: 0x1.b1ae4ep+69f, .fmt: chars_format::general, .precision: 39, .correct: "1000000020040877342720" }, |
1181 | {.value: 0x1.0f0cf0p+73f, .fmt: chars_format::general, .precision: 39, .correct: "9999999778196308361216" }, |
1182 | {.value: 0x1.0f0cf2p+73f, .fmt: chars_format::general, .precision: 39, .correct: "10000000904096215203840" }, |
1183 | {.value: 0x1.52d02cp+76f, .fmt: chars_format::general, .precision: 39, .correct: "99999997781963083612160" }, |
1184 | {.value: 0x1.52d02ep+76f, .fmt: chars_format::general, .precision: 39, .correct: "100000006789162338353152" }, |
1185 | {.value: 0x1.a78436p+79f, .fmt: chars_format::general, .precision: 39, .correct: "999999941790833817157632" }, |
1186 | {.value: 0x1.a78438p+79f, .fmt: chars_format::general, .precision: 39, .correct: "1000000013848427855085568" }, |
1187 | {.value: 0x1.08b2a2p+83f, .fmt: chars_format::general, .precision: 39, .correct: "9999999562023526247432192" }, |
1188 | {.value: 0x1.08b2a4p+83f, .fmt: chars_format::general, .precision: 39, .correct: "10000000714945030854279168" }, |
1189 | {.value: 0x1.4adf4ap+86f, .fmt: chars_format::general, .precision: 39, .correct: "99999993314392253260627968" }, |
1190 | {.value: 0x1.4adf4cp+86f, .fmt: chars_format::general, .precision: 39, .correct: "100000002537764290115403776" }, |
1191 | {.value: 0x1.9d971ep+89f, .fmt: chars_format::general, .precision: 39, .correct: "999999988484154753734934528" }, |
1192 | {.value: 0x1.9d9720p+89f, .fmt: chars_format::general, .precision: 39, .correct: "1000000062271131048573140992" }, |
1193 | {.value: 0x1.027e72p+93f, .fmt: chars_format::general, .precision: 39, .correct: "9999999442119689768320106496" }, |
1194 | {.value: 0x1.027e74p+93f, .fmt: chars_format::general, .precision: 39, .correct: "10000000622711310485731409920" }, |
1195 | {.value: 0x1.431e0ep+96f, .fmt: chars_format::general, .precision: 39, .correct: "99999992060013656248378458112" }, |
1196 | {.value: 0x1.431e10p+96f, .fmt: chars_format::general, .precision: 39, .correct: "100000001504746621987668885504" }, |
1197 | {.value: 0x1.93e592p+99f, .fmt: chars_format::general, .precision: 39, .correct: "999999939489602493962365435904" }, |
1198 | {.value: 0x1.93e594p+99f, .fmt: chars_format::general, .precision: 39, .correct: "1000000015047466219876688855040" }, |
1199 | {.value: 0x1.f8def8p+102f, .fmt: chars_format::general, .precision: 39, .correct: "9999999848243207295109594873856" }, |
1200 | {.value: 0x1.f8defap+102f, .fmt: chars_format::general, .precision: 39, .correct: "10000000452706117102424182226944" }, |
1201 | {.value: 0x1.3b8b5ap+106f, .fmt: chars_format::general, .precision: 39, .correct: "99999993646728794492579249913856" }, |
1202 | {.value: 0x1.3b8b5cp+106f, .fmt: chars_format::general, .precision: 39, .correct: "100000003318135351409612647563264" }, |
1203 | {.value: 0x1.8a6e32p+109f, .fmt: chars_format::general, .precision: 39, .correct: "999999994495727286427992885035008" }, |
1204 | {.value: 0x1.8a6e34p+109f, .fmt: chars_format::general, .precision: 39, .correct: "1000000071866979741764260066230272" }, |
1205 | {.value: 0x1.ed09bep+112f, .fmt: chars_format::general, .precision: 39, .correct: "9999999790214767953607394487959552" }, |
1206 | {.value: 0x1.ed09c0p+112f, .fmt: chars_format::general, .precision: 39, .correct: "10000000409184787596297531937521664" }, |
1207 | {.value: 0x1.342616p+116f, .fmt: chars_format::general, .precision: 39, .correct: "99999994188327561679933120182222848" }, |
1208 | {.value: 0x1.342618p+116f, .fmt: chars_format::general, .precision: 39, .correct: "100000004091847875962975319375216640" }, |
1209 | {.value: 0x1.812f9cp+119f, .fmt: chars_format::general, .precision: 39, .correct: "999999961690316245365415600208216064" }, |
1210 | {.value: 0x1.812f9ep+119f, .fmt: chars_format::general, .precision: 39, .correct: "1000000040918478759629753193752166400" }, |
1211 | {.value: 0x1.e17b84p+122f, .fmt: chars_format::general, .precision: 39, .correct: "9999999933815812510711506376257961984" }, |
1212 | {.value: 0x1.e17b86p+122f, .fmt: chars_format::general, .precision: 39, .correct: "10000000567641112624826207124609564672" }, |
1213 | {.value: 0x1.2ced32p+126f, .fmt: chars_format::general, .precision: 39, .correct: "99999996802856924650656260769173209088" }, |
1214 | {.value: 0x1.2ced34p+126f, .fmt: chars_format::general, .precision: 39, .correct: "100000006944061726476491472742798852096" }, |
1215 | {.value: 0x1.fffffep+127f, .fmt: chars_format::general, .precision: 39, .correct: "340282346638528859811704183484516925440" }, |
1216 | }; |
1217 | |
1218 | #endif // FLOAT_GENERAL_PRECISION_TO_CHARS_TEST_CASES_HPP |
1219 | |