Lines Matching +full:check +full:- +full:32 +full:bit
9 // (See accompanying file LICENSE-Apache or copy at
10 // http://www.apache.org/licenses/LICENSE-2.0)
14 // (See accompanying file LICENSE-Boost or copy at
36 fn pretty(f: f64) -> String { in pretty()
40 fn ieee_parts_to_double(sign: bool, ieee_exponent: u32, ieee_mantissa: u64) -> f64 { in ieee_parts_to_double()
42 assert!(ieee_mantissa <= (1u64 << 53) - 1); in ieee_parts_to_double()
48 check!(0.3); in test_ryu()
49 check!(1234000000000000.0); in test_ryu()
50 check!(1.234e16); in test_ryu()
51 check!(2.71828); in test_ryu()
52 check!(1.1e128); in test_ryu()
53 check!(1.1e-64); in test_ryu()
54 check!(2.718281828459045); in test_ryu()
55 check!(5e-324); in test_ryu()
56 check!(1.7976931348623157e308); in test_ryu()
73 let f = f64::from_bits((((1 << 11) - 1) << 52) + (i << 29)); in test_non_finite()
81 check!(0.0); in test_basic()
82 check!(-0.0); in test_basic()
83 check!(1.0); in test_basic()
84 check!(-1.0); in test_basic()
86 assert_eq!(pretty(f64::NAN.copysign(-1.0)), "NaN"); in test_basic()
88 assert_eq!(pretty(f64::NEG_INFINITY), "-inf"); in test_basic()
93 check!(2.2250738585072014e-308); in test_switch_to_subnormal()
99 check!(1.7976931348623157e308); in test_min_and_max()
100 assert_eq!(f64::from_bits(1), 5e-324); in test_min_and_max()
101 check!(5e-324); in test_min_and_max()
106 check!(2.9802322387695312e-8); in test_lots_of_trailing_zeros()
111 check!(-2.109808898695963e16); in test_regression()
112 check!(4.940656e-318); in test_regression()
113 check!(1.18575755e-316); in test_regression()
114 check!(2.989102097996e-312); in test_regression()
115 check!(9060801153433600.0); in test_regression()
116 check!(4.708356024711512e18); in test_regression()
117 check!(9.409340012568248e18); in test_regression()
118 check!(1.2345678); in test_regression()
127 check!(5.764607523034235e39); in test_looks_like_pow5()
129 check!(1.152921504606847e40); in test_looks_like_pow5()
131 check!(2.305843009213694e40); in test_looks_like_pow5()
136 check!(1.0); // already tested in Basic in test_output_length()
137 check!(1.2); in test_output_length()
138 check!(1.23); in test_output_length()
139 check!(1.234); in test_output_length()
140 check!(1.2345); in test_output_length()
141 check!(1.23456); in test_output_length()
142 check!(1.234567); in test_output_length()
143 check!(1.2345678); // already tested in Regression in test_output_length()
144 check!(1.23456789); in test_output_length()
145 check!(1.234567895); // 1.234567890 would be trimmed in test_output_length()
146 check!(1.2345678901); in test_output_length()
147 check!(1.23456789012); in test_output_length()
148 check!(1.234567890123); in test_output_length()
149 check!(1.2345678901234); in test_output_length()
150 check!(1.23456789012345); in test_output_length()
151 check!(1.234567890123456); in test_output_length()
152 check!(1.2345678901234567); in test_output_length()
154 // Test 32-bit chunking in test_output_length()
155 check!(4.294967294); // 2^32 - 2 in test_output_length()
156 check!(4.294967295); // 2^32 - 1 in test_output_length()
157 check!(4.294967296); // 2^32 in test_output_length()
158 check!(4.294967297); // 2^32 + 1 in test_output_length()
159 check!(4.294967298); // 2^32 + 2 in test_output_length()
165 let max_mantissa = (1u64 << 53) - 1; in test_min_max_shift()
167 // 32-bit opt-size=0: 49 <= dist <= 50 in test_min_max_shift()
168 // 32-bit opt-size=1: 30 <= dist <= 50 in test_min_max_shift()
169 // 64-bit opt-size=0: 50 <= dist <= 50 in test_min_max_shift()
170 // 64-bit opt-size=1: 30 <= dist <= 50 in test_min_max_shift()
171 assert_eq!(1.7800590868057611E-307, ieee_parts_to_double(false, 4, 0)); in test_min_max_shift()
172 check!(1.7800590868057611e-307); in test_min_max_shift()
173 // 32-bit opt-size=0: 49 <= dist <= 49 in test_min_max_shift()
174 // 32-bit opt-size=1: 28 <= dist <= 49 in test_min_max_shift()
175 // 64-bit opt-size=0: 50 <= dist <= 50 in test_min_max_shift()
176 // 64-bit opt-size=1: 28 <= dist <= 50 in test_min_max_shift()
178 2.8480945388892175E-306, in test_min_max_shift()
181 check!(2.8480945388892175e-306); in test_min_max_shift()
182 // 32-bit opt-size=0: 52 <= dist <= 53 in test_min_max_shift()
183 // 32-bit opt-size=1: 2 <= dist <= 53 in test_min_max_shift()
184 // 64-bit opt-size=0: 53 <= dist <= 53 in test_min_max_shift()
185 // 64-bit opt-size=1: 2 <= dist <= 53 in test_min_max_shift()
186 assert_eq!(2.446494580089078E-296, ieee_parts_to_double(false, 41, 0)); in test_min_max_shift()
187 check!(2.446494580089078e-296); in test_min_max_shift()
188 // 32-bit opt-size=0: 52 <= dist <= 52 in test_min_max_shift()
189 // 32-bit opt-size=1: 2 <= dist <= 52 in test_min_max_shift()
190 // 64-bit opt-size=0: 53 <= dist <= 53 in test_min_max_shift()
191 // 64-bit opt-size=1: 2 <= dist <= 53 in test_min_max_shift()
193 4.8929891601781557E-296, in test_min_max_shift()
196 check!(4.8929891601781557e-296); in test_min_max_shift()
198 // 32-bit opt-size=0: 57 <= dist <= 58 in test_min_max_shift()
199 // 32-bit opt-size=1: 57 <= dist <= 58 in test_min_max_shift()
200 // 64-bit opt-size=0: 58 <= dist <= 58 in test_min_max_shift()
201 // 64-bit opt-size=1: 58 <= dist <= 58 in test_min_max_shift()
203 check!(1.8014398509481984e16); in test_min_max_shift()
204 // 32-bit opt-size=0: 57 <= dist <= 57 in test_min_max_shift()
205 // 32-bit opt-size=1: 57 <= dist <= 57 in test_min_max_shift()
206 // 64-bit opt-size=0: 58 <= dist <= 58 in test_min_max_shift()
207 // 64-bit opt-size=1: 58 <= dist <= 58 in test_min_max_shift()
212 check!(3.6028797018963964e16); in test_min_max_shift()
213 // 32-bit opt-size=0: 51 <= dist <= 52 in test_min_max_shift()
214 // 32-bit opt-size=1: 51 <= dist <= 59 in test_min_max_shift()
215 // 64-bit opt-size=0: 52 <= dist <= 52 in test_min_max_shift()
216 // 64-bit opt-size=1: 52 <= dist <= 59 in test_min_max_shift()
217 assert_eq!(2.900835519859558E-216, ieee_parts_to_double(false, 307, 0)); in test_min_max_shift()
218 check!(2.900835519859558e-216); in test_min_max_shift()
219 // 32-bit opt-size=0: 51 <= dist <= 51 in test_min_max_shift()
220 // 32-bit opt-size=1: 51 <= dist <= 59 in test_min_max_shift()
221 // 64-bit opt-size=0: 52 <= dist <= 52 in test_min_max_shift()
222 // 64-bit opt-size=1: 52 <= dist <= 59 in test_min_max_shift()
224 5.801671039719115E-216, in test_min_max_shift()
227 check!(5.801671039719115e-216); in test_min_max_shift()
229 …tps://github.com/ulfjack/ryu/commit/19e44d16d80236f5de25800f56d82606d1be00b9#commitcomment-30146483 in test_min_max_shift()
230 // 32-bit opt-size=0: 49 <= dist <= 49 in test_min_max_shift()
231 // 32-bit opt-size=1: 44 <= dist <= 49 in test_min_max_shift()
232 // 64-bit opt-size=0: 50 <= dist <= 50 in test_min_max_shift()
233 // 64-bit opt-size=1: 44 <= dist <= 50 in test_min_max_shift()
235 3.196104012172126E-27, in test_min_max_shift()
238 check!(3.196104012172126e-27); in test_min_max_shift()
243 check!(9007199254740991.0); // 2^53-1 in test_small_integers()
244 check!(9007199254740992.0); // 2^53 in test_small_integers()
246 check!(1.0); in test_small_integers()
247 check!(12.0); in test_small_integers()
248 check!(123.0); in test_small_integers()
249 check!(1234.0); in test_small_integers()
250 check!(12345.0); in test_small_integers()
251 check!(123456.0); in test_small_integers()
252 check!(1234567.0); in test_small_integers()
253 check!(12345678.0); in test_small_integers()
254 check!(123456789.0); in test_small_integers()
255 check!(1234567890.0); in test_small_integers()
256 check!(1234567895.0); in test_small_integers()
257 check!(12345678901.0); in test_small_integers()
258 check!(123456789012.0); in test_small_integers()
259 check!(1234567890123.0); in test_small_integers()
260 check!(12345678901234.0); in test_small_integers()
261 check!(123456789012345.0); in test_small_integers()
262 check!(1234567890123456.0); in test_small_integers()
265 check!(1.0); in test_small_integers()
266 check!(10.0); in test_small_integers()
267 check!(100.0); in test_small_integers()
268 check!(1000.0); in test_small_integers()
269 check!(10000.0); in test_small_integers()
270 check!(100000.0); in test_small_integers()
271 check!(1000000.0); in test_small_integers()
272 check!(10000000.0); in test_small_integers()
273 check!(100000000.0); in test_small_integers()
274 check!(1000000000.0); in test_small_integers()
275 check!(10000000000.0); in test_small_integers()
276 check!(100000000000.0); in test_small_integers()
277 check!(1000000000000.0); in test_small_integers()
278 check!(10000000000000.0); in test_small_integers()
279 check!(100000000000000.0); in test_small_integers()
280 check!(1000000000000000.0); in test_small_integers()
283 check!(1000000000000001.0); in test_small_integers()
284 check!(1000000000000010.0); in test_small_integers()
285 check!(1000000000000100.0); in test_small_integers()
286 check!(1000000000001000.0); in test_small_integers()
287 check!(1000000000010000.0); in test_small_integers()
288 check!(1000000000100000.0); in test_small_integers()
289 check!(1000000001000000.0); in test_small_integers()
290 check!(1000000010000000.0); in test_small_integers()
291 check!(1000000100000000.0); in test_small_integers()
292 check!(1000001000000000.0); in test_small_integers()
293 check!(1000010000000000.0); in test_small_integers()
294 check!(1000100000000000.0); in test_small_integers()
295 check!(1001000000000000.0); in test_small_integers()
296 check!(1010000000000000.0); in test_small_integers()
297 check!(1100000000000000.0); in test_small_integers()
300 check!(8.0); in test_small_integers()
301 check!(64.0); in test_small_integers()
302 check!(512.0); in test_small_integers()
303 check!(8192.0); in test_small_integers()
304 check!(65536.0); in test_small_integers()
305 check!(524288.0); in test_small_integers()
306 check!(8388608.0); in test_small_integers()
307 check!(67108864.0); in test_small_integers()
308 check!(536870912.0); in test_small_integers()
309 check!(8589934592.0); in test_small_integers()
310 check!(68719476736.0); in test_small_integers()
311 check!(549755813888.0); in test_small_integers()
312 check!(8796093022208.0); in test_small_integers()
313 check!(70368744177664.0); in test_small_integers()
314 check!(562949953421312.0); in test_small_integers()
315 check!(9007199254740992.0); in test_small_integers()
318 check!(8000.0); in test_small_integers()
319 check!(64000.0); in test_small_integers()
320 check!(512000.0); in test_small_integers()
321 check!(8192000.0); in test_small_integers()
322 check!(65536000.0); in test_small_integers()
323 check!(524288000.0); in test_small_integers()
324 check!(8388608000.0); in test_small_integers()
325 check!(67108864000.0); in test_small_integers()
326 check!(536870912000.0); in test_small_integers()
327 check!(8589934592000.0); in test_small_integers()
328 check!(68719476736000.0); in test_small_integers()
329 check!(549755813888000.0); in test_small_integers()
330 check!(8796093022208000.0); in test_small_integers()