diff --git a/moo/kernel/test-001.moo b/moo/kernel/test-001.moo index 419b1f7..b5fa4ec 100644 --- a/moo/kernel/test-001.moo +++ b/moo/kernel/test-001.moo @@ -384,6 +384,7 @@ extend MyObject [ self testBigintDiv: 16rfffffffe0000000080000000 divisor: 16r0000ffff0000000080000000 count: 12345 ], [ self testBigintDiv: 16rfffffffffffffffe divisor: 16rffffffff count: 2000 ], [ self testBigintDiv: 68651967526299315528548877601614136727014 divisor: 1729382256910270380 count: 1 ], + [ self testBigintDiv: 43943618413704592900396132847030223073729048496 divisor: 1135814937804493543741046072006331 count: 1 ], ## ========================= diff --git a/moo/lib/bigint.c b/moo/lib/bigint.c index 21edc35..7a91d6e 100644 --- a/moo/lib/bigint.c +++ b/moo/lib/bigint.c @@ -1833,8 +1833,7 @@ static void divide_unsigned_array2 (moo_t* moo, const moo_liw_t* x, moo_oow_t xs /* TODO: optimize it with ASM - no seperate / and % */ quo = dw / y1; rem = dw % y1; - /*rem = dw - (quo * y1);*/ -#if 0 +#if 1 adjust_quotient: if (quo > MOO_TYPE_MAX(moo_liw_t) || (quo * y2) > ((rem << MOO_LIW_BITS) + q[i - 2])) {