bigint.c (udiv): should trim remainder before bit shifting.

This commit is contained in:
Yukihiro "Matz" Matsumoto
2022-07-25 14:44:00 +09:00
parent e02e9ae434
commit 6a4c8e36b5
+1
View File
@@ -465,6 +465,7 @@ udiv(mrb_state *mrb, mpz_t *qq, mpz_t *rr, mpz_t *xx, mpz_t *yy)
q.p[j] = qhat;
if (j == 0) break;
}
x.sz = yy->sz;
urshift(mrb, rr, &x, ns);
trim(&q);
mpz_set(mrb, qq, &q);