diff --git a/script/print-render-number-f64-tests.go b/script/print-render-number-f64-tests.go index c3ec88de..792e2d0f 100644 --- a/script/print-render-number-f64-tests.go +++ b/script/print-render-number-f64-tests.go @@ -126,6 +126,10 @@ var f64TestCases = []float64{ 6.022141e23, 6.0221408e23, 6.02214076e23, + + // Some "parse to float64" implementations find this one tricky. + // https://github.com/serde-rs/json/issues/707 + 122.416294033786585, } var u64TestCases = []uint64{ diff --git a/test/c/std/json.c b/test/c/std/json.c index 1d76f9a2..356fe427 100644 --- a/test/c/std/json.c +++ b/test/c/std/json.c @@ -1008,6 +1008,9 @@ test_wuffs_strconv_parse_number_f64_regular() { {.want = 0x4038000000000000, .str = "2.4E1"}, {.want = 0x4038000000000000, .str = "24"}, {.want = 0x4038000000000000, .str = "2400_00000_00000.00000_e-_1_2"}, + {.want = 0x405E9AA48FBB2888, .str = "122.416294033786585"}, + {.want = 0x405E9AA48FBB2888, .str = "122.41629403378658"}, + {.want = 0x405E9AA48FBB2889, .str = "122.4162940337866"}, {.want = 0x40FE240C9FCB0C02, .str = "123456.789012"}, {.want = 0x41E0246690000001, .str = "2.16656806400000023841857910156251e9"}, @@ -1709,6 +1712,15 @@ test_wuffs_strconv_render_number_f64() { .want_3f = "24.000", .want_4g = "24", }, + { + .x = 0x405E9AA48FBB2888, + .want__e = "1.2241629403378658e+02", + .want__f = "122.41629403378658", + .want_0g = "1e+02", + .want_2e = "1.22e+02", + .want_3f = "122.416", + .want_4g = "122.4", + }, { .x = 0x40FE240C9FCB0C02, .want__e = "1.23456789012e+05",