2 use core::num::bignum::Big32x40 as Big;
3 use core::num::flt2dec::strategy::dragon::*;
7 let mut prevpow10 = Big::from_small(1);
9 let mut curpow10 = Big::from_small(1);
10 mul_pow10(&mut curpow10, i);
11 assert_eq!(curpow10, *prevpow10.clone().mul_small(10));
16 #[cfg_attr(all(target_arch = "wasm32", target_os = "emscripten"), ignore)] // issue 42630
18 fn shortest_sanity_test() {
19 f64_shortest_sanity_test(format_shortest);
20 f32_shortest_sanity_test(format_shortest);
21 more_shortest_sanity_test(format_shortest);
25 #[cfg(not(miri))] // Miri is too slow
26 fn exact_sanity_test() {
27 // This test ends up running what I can only assume is some corner-ish case
28 // of the `exp2` library function, defined in whatever C runtime we're
29 // using. In VS 2013 this function apparently had a bug as this test fails
30 // when linked, but with VS 2015 the bug appears fixed as the test runs just
33 // The bug seems to be a difference in return value of `exp2(-1057)`, where
34 // in VS 2013 it returns a double with the bit pattern 0x2 and in VS 2015 it
37 // For now just ignore this test entirely on MSVC as it's tested elsewhere
38 // anyway and we're not super interested in testing each platform's exp2
40 if !cfg!(target_env = "msvc") {
41 f64_exact_sanity_test(format_exact);
43 f32_exact_sanity_test(format_exact);
47 fn test_to_shortest_str() {
48 to_shortest_str_test(format_shortest);
52 fn test_to_shortest_exp_str() {
53 to_shortest_exp_str_test(format_shortest);
57 fn test_to_exact_exp_str() {
58 to_exact_exp_str_test(format_exact);
62 fn test_to_exact_fixed_str() {
63 to_exact_fixed_str_test(format_exact);