Fix constant x %% y evaluation

This commit is contained in:
gingerBill
2026-06-24 10:35:36 +01:00
parent 58aac9065a
commit 55b63099a8
2 changed files with 9 additions and 1 deletions

View File

@@ -432,6 +432,14 @@ gb_internal void big_int_rem(BigInt *z, BigInt const *x, BigInt const *y) {
big_int_quo_rem(x, y, &q, z);
big_int_dealloc(&q);
}
gb_internal void big_int_mod_mod(BigInt *z, BigInt const *x, BigInt const *y) {
BigInt q = {};
big_int_rem(&q, x, y);
big_int_add(&q, &q, y);
big_int_rem(z, &q, y);
big_int_dealloc(&q);
}
gb_internal void big_int_euclidean_mod(BigInt *z, BigInt const *x, BigInt const *y) {
BigInt y0 = {};