added test for parsing 0e100

This commit is contained in:
John Stiles 2018-05-11 15:16:46 -07:00
parent 532cba1422
commit f7d2cd2228
2 changed files with 2 additions and 0 deletions

View File

@ -99,6 +99,7 @@ struct DiyFp {
}
DiyFp Normalize() const {
RAPIDJSON_ASSERT(f != 0); // https://stackoverflow.com/a/26809183/291737
#if defined(_MSC_VER) && defined(_M_AMD64)
unsigned long index;
_BitScanReverse64(&index, f);

View File

@ -207,6 +207,7 @@ static void TestParseDouble() {
TEST_DOUBLE(fullPrecision, "0.0", 0.0);
TEST_DOUBLE(fullPrecision, "-0.0", -0.0); // For checking issue #289
TEST_DOUBLE(fullPrecision, "0e100", 0.0); // Normalize() must not invoke __builtin_clzll(0)
TEST_DOUBLE(fullPrecision, "1.0", 1.0);
TEST_DOUBLE(fullPrecision, "-1.0", -1.0);
TEST_DOUBLE(fullPrecision, "1.5", 1.5);