From e7f6c42a793e3736398f19740cc341fed177253a Mon Sep 17 00:00:00 2001 From: Anton Danielsson Date: Mon, 5 Oct 2015 14:26:31 +0200 Subject: [PATCH] Fixed bug in "ToExponentAndMantissa" when negative exponents where created. Unary minus where applied to an unsigned type. --- src/string_util.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/string_util.cc b/src/string_util.cc index aeb9bc8a..6dc7f5ec 100644 --- a/src/string_util.cc +++ b/src/string_util.cc @@ -66,7 +66,7 @@ void ToExponentAndMantissa(double val, double thresh, int precision, scaled *= one_k; if (scaled >= small_threshold) { mantissa_stream << scaled; - *exponent = -i - 1; + *exponent = -static_cast(i + 1); *mantissa = mantissa_stream.str(); return; }