From d0f98d2da1e2e6345831dc1ab2c30950417e6490 Mon Sep 17 00:00:00 2001 From: miloyip Date: Sun, 7 Sep 2014 15:20:09 +0800 Subject: [PATCH] Fix a bug in dtoa on gcc Discovered in https://github.com/miloyip/dtoa-benchmark/issues/1 with assertion fail. --- include/rapidjson/internal/dtoa.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/rapidjson/internal/dtoa.h b/include/rapidjson/internal/dtoa.h index bef02b0..f8ecc27 100644 --- a/include/rapidjson/internal/dtoa.h +++ b/include/rapidjson/internal/dtoa.h @@ -105,7 +105,7 @@ struct DiyFp { _BitScanReverse64(&index, f); return DiyFp(f << (63 - index), e - (63 - index)); #elif defined(__GNUC__) - int s = __builtin_clzll(f) + 1; + int s = __builtin_clzll(f); return DiyFp(f << s, e - s); #else DiyFp res = *this;