Add more parse_number_f64 test cases

This commit is contained in:
Nigel Tao committed 2020-09-28 12:51:45 +10:00
1 parent 6c2fb9a2fd
commit ba3818cb6b
5 files changed
+98 -5

No files matched your search

+31
View File
@@ -971,8 +971,10 @@ test_wuffs_strconv_parse_number_f64_regular() {
{.want = 0x000FFFFFFFFFFFFF, .str = "2.2250738585072009E-308"},
{.want = 0x0010000000000000, .str = "2.2250738585072014E-308"},
{.want = 0x0031FA182C40C60D, .str = "1e-307"},
{.want = 0x369C2DF8DA5B6CA8, .str = "1.234e-45"},
{.want = 0x369C314ABE948EB1,
.str = "0.0000000000000000000000000000000000000000000012345678900000"},
{.want = 0x3E70000000000000, .str = "5.9604644775390625e-8"},
{.want = 0x3F88000000000000, .str = "0.01171875"},
{.want = 0x3FD0000000000000, .str = ".25"},
{.want = 0x3FD3333333333333,
@@ -1024,8 +1026,10 @@ test_wuffs_strconv_parse_number_f64_regular() {
{.want = 0x4340000000000002, .str = "9007199254740996"},
{.want = 0x4340000000000002, .str = "9_007__199_254__740_996"},
{.want = 0x4370000000000000, .str = "7.2057594037927933e+16"},
{.want = 0x43E158E460913D00, .str = "9999999999999999999"},
{.want = 0x43F002F1776DDA67, .str = "18459999196907202592"},
{.want = 0x4415AF1D78B58C40, .str = "1e20"},
{.want = 0x44B52D02C7E14AF6, .str = "1e+23"},
{.want = 0x44B52D02C7E14AF6, .str = "1e23"},
{.want = 0x46293E5939A08CEA, .str = "1e30"},
{.want = 0x54B249AD2594C37D, .str = "+1E+100"},
@@ -1425,6 +1429,15 @@ test_wuffs_strconv_render_number_f64() {
.want_3f = "0.000",
.want_4g = "1e-307",
},
{
.x = 0x369C2DF8DA5B6CA8,
.want__e = "1.234e-45",
.want__f = "0.000000000000000000000000000000000000000000001234",
.want_0g = "1e-45",
.want_2e = "1.23e-45",
.want_3f = "0.000",
.want_4g = "1.234e-45",
},
{
.x = 0x369C314ABE948EB1,
.want__e = "1.23456789e-45",
@@ -1435,6 +1448,15 @@ test_wuffs_strconv_render_number_f64() {
.want_3f = "0.000",
.want_4g = "1.235e-45",
},
{
.x = 0x3E70000000000000,
.want__e = "5.960464477539063e-08",
.want__f = "0.00000005960464477539063",
.want_0g = "6e-08",
.want_2e = "5.96e-08",
.want_3f = "0.000",
.want_4g = "5.96e-08",
},
{
.x = 0x3F88000000000000,
.want__e = "1.171875e-02",
@@ -1795,6 +1817,15 @@ test_wuffs_strconv_render_number_f64() {
.want_3f = "72057594037927936.000",
.want_4g = "7.206e+16",
},
{
.x = 0x43E158E460913D00,
.want__e = "1e+19",
.want__f = "10000000000000000000",
.want_0g = "1e+19",
.want_2e = "1.00e+19",
.want_3f = "10000000000000000000.000",
.want_4g = "1e+19",
},
{
.x = 0x43F002F1776DDA67,
.want__e = "1.8459999196907205e+19",