Skip to content

Commit 1ccabed

Browse files
committed
Fix deduction failure for std::min call
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`.
1 parent b15abc9 commit 1ccabed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/fast_float/digit_comparison.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ fastfloat_really_inline void round(adjusted_mantissa& am, callback cb) noexcept
8686
if (-am.power2 >= mantissa_shift) {
8787
// have a denormal float
8888
int32_t shift = -am.power2 + 1;
89-
cb(am, std::min(shift, 64));
89+
cb(am, std::min<int32_t>(shift, 64));
9090
// check for round-up: if rounding-nearest carried us to the hidden bit.
9191
am.power2 = (am.mantissa < (uint64_t(1) << binary_format<T>::mantissa_explicit_bits())) ? 0 : 1;
9292
return;

0 commit comments

Comments
 (0)