From d26a697a4d98c642aa5758ac6a91572f437f8b13 Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Mon, 9 Nov 2020 20:22:45 -0500 Subject: [PATCH] Added remark. --- include/fast_float/simple_decimal_conversion.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/fast_float/simple_decimal_conversion.h b/include/fast_float/simple_decimal_conversion.h index f87dbb3..5c107bc 100644 --- a/include/fast_float/simple_decimal_conversion.h +++ b/include/fast_float/simple_decimal_conversion.h @@ -360,6 +360,8 @@ adjusted_mantissa parse_long_mantissa(const char *first, const char* last) { // credit: R. Oudompheng who first implemented this fast path (to my knowledge). // It is rough, but it does the job of accelerating the slow path since most // long streams of digits are determined after 19 digits. + // Note that mantissa+1 cannot overflow since mantissa < 10**19 and so + // mantissa+1 <= 10**19 < 2**64. adjusted_mantissa am1 = compute_float(exponent, mantissa); adjusted_mantissa am2 = compute_float(exponent, mantissa+1); // They must both agree and be both a successful result.