Fixes parsing small floating point values underflow

https://code.google.com/p/rapidjson/issues/detail?id=75

The modification is slightly different from dlbattle123 to improve
speed.
This commit is contained in:
Milo Yip
2014-06-30 21:26:43 +08:00
parent 2e156ccacd
commit 10924e389c
2 changed files with 12 additions and 3 deletions

View File

@@ -129,9 +129,10 @@ TEST(Reader, ParseNumberHandler) {
TEST_DOUBLE("1.234E+10", 1.234E+10);
TEST_DOUBLE("1.234E-10", 1.234E-10);
TEST_DOUBLE("1.79769e+308", 1.79769e+308);
//TEST_DOUBLE("2.22507e-308", 2.22507e-308); // TODO: underflow
__asm int 3;
TEST_DOUBLE("2.22507e-308", 2.22507e-308);
TEST_DOUBLE("-1.79769e+308", -1.79769e+308);
//TEST_DOUBLE("-2.22507e-308", -2.22507e-308); // TODO: underflow
TEST_DOUBLE("-2.22507e-308", -2.22507e-308);
TEST_DOUBLE("18446744073709551616", 18446744073709551616.0); // 2^64 (max of uint64_t + 1, force to use double)
TEST_DOUBLE("-9223372036854775809", -9223372036854775809.0); // -2^63 - 1(min of int64_t + 1, force to use double)