mirror of
https://github.com/google/benchmark.git
synced 2025-04-02 23:51:35 +08:00
Fixed bug in "ToExponentAndMantissa" when negative exponents where created.
Unary minus where applied to an unsigned type.
This commit is contained in:
parent
a822c71655
commit
e7f6c42a79
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user