Merge pull request #1252 from StilesCrisis/issue-1251-test

Unit Test: Parsing "128.74836467836484838364836483643636483648e-336" causes a crash
This commit is contained in:
Milo Yip 2018-06-19 12:43:54 +08:00 committed by GitHub
commit 7e68aa0a21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -245,6 +245,7 @@ static void TestParseDouble() {
TEST_DOUBLE(fullPrecision, "1e-21474836311", 0.0);
TEST_DOUBLE(fullPrecision, "1.00000000001e-2147483638", 0.0);
TEST_DOUBLE(fullPrecision, "0.017976931348623157e+310", 1.7976931348623157e+308); // Max double in another form
TEST_DOUBLE(fullPrecision, "128.74836467836484838364836483643636483648e-336", 0.0); // Issue #1251
// Since
// abs((2^-1022 - 2^-1074) - 2.2250738585072012e-308) = 3.109754131239141401123495768877590405345064751974375599... x 10^-324