diff --git a/include/fast_float/ascii_number.h b/include/fast_float/ascii_number.h index 69366fe..995fc47 100644 --- a/include/fast_float/ascii_number.h +++ b/include/fast_float/ascii_number.h @@ -31,7 +31,9 @@ fastfloat_really_inline constexpr bool has_simd_opt() noexcept { // able to optimize it well. template fastfloat_really_inline constexpr bool is_integer(UC c) noexcept { - return static_cast(c - UC('0')) <= 9; + const auto d = c - UC('0'); + // UC may be signed. + return d >= 0 && d <= 9; } #if FASTFLOAT_IS_BIG_ENDIAN