There was an error while loading. Please reload this page.
1 parent 4a2c696 commit 488044aCopy full SHA for 488044a
include/slimcpplib/long_fixdiv.h
@@ -159,8 +159,8 @@ constexpr long_fixed_divider<type_t> long_fixed_divider<type_t>::create(const ty
159
160
if (divider == 1) {
161
162
- multiplier = ~type_t(0);
163
- addition = ~type_t(0);
+ multiplier = type_t(~type_t(0));
+ addition = type_t(~type_t(0));
164
shift = 0;
165
166
} else {
@@ -182,8 +182,8 @@ constexpr type_t long_fixed_divider<type_t>::divide(const type_t& dividend) cons
182
type_t mul_lo = dividend;
183
type_t mul_hi = mul(mul_lo, multiplier);
184
185
- //if (addition != 0)
186
- mul_hi += add(mul_lo, addition);
+ if (addition != 0)
+ mul_hi += add(mul_lo, addition);
187
188
return mul_hi >>= shift;
189
}
0 commit comments