mirror of
https://github.com/Tencent/rapidjson.git
synced 2025-10-28 03:20:15 +01:00
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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user