Commit e7f6c42a by Anton Danielsson

Fixed bug in "ToExponentAndMantissa" when negative exponents where created.

Unary minus where applied to an unsigned type.
parent a822c716
...@@ -66,7 +66,7 @@ void ToExponentAndMantissa(double val, double thresh, int precision, ...@@ -66,7 +66,7 @@ void ToExponentAndMantissa(double val, double thresh, int precision,
scaled *= one_k; scaled *= one_k;
if (scaled >= small_threshold) { if (scaled >= small_threshold) {
mantissa_stream << scaled; mantissa_stream << scaled;
*exponent = -i - 1; *exponent = -static_cast<int64_t>(i + 1);
*mantissa = mantissa_stream.str(); *mantissa = mantissa_stream.str();
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment