Skip to content

Commit

Permalink
Fix deduction failure for std::min call
Browse files Browse the repository at this point in the history
This assumes that the literal `64` of type `int` has the same type as
the `int32_t` typedef, which is never true for targets with 16-bit
`int`, and isn't guaranteed to be true even with 32-bit `int`.
  • Loading branch information
jwakely committed Jan 18, 2022
1 parent b15abc9 commit 1ccabed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/fast_float/digit_comparison.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ fastfloat_really_inline void round(adjusted_mantissa& am, callback cb) noexcept
if (-am.power2 >= mantissa_shift) {
// have a denormal float
int32_t shift = -am.power2 + 1;
cb(am, std::min(shift, 64));
cb(am, std::min<int32_t>(shift, 64));
// check for round-up: if rounding-nearest carried us to the hidden bit.
am.power2 = (am.mantissa < (uint64_t(1) << binary_format<T>::mantissa_explicit_bits())) ? 0 : 1;
return;
Expand Down

0 comments on commit 1ccabed

Please sign in to comment.