diff --git a/stl/inc/bit b/stl/inc/bit index fe1d267f7fd..eeed2dcd357 100644 --- a/stl/inc/bit +++ b/stl/inc/bit @@ -253,7 +253,7 @@ _NODISCARD int _Checked_arm_arm64_countl_zero(const _Ty _Val) noexcept { } #else // ^^^ workaround / no workaround vvv if constexpr (_Digits <= 32) { - return static_cast(_CountLeadingZeros(_Val)); + return static_cast(_CountLeadingZeros(_Val)) - (numeric_limits::digits - _Digits); } else { return static_cast(_CountLeadingZeros64(_Val)); }