From 4fc7181c2c03c8cc443d33d7344771ce57448f1a Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Mon, 15 Jun 2015 23:31:46 +0900 Subject: [PATCH] Fix in sexp_bignum_quot_rem when the numerator and divisor are equal. Fixes issue #269. --- bignum.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bignum.c b/bignum.c index 7e3235c7..c9f2d4e4 100644 --- a/bignum.c +++ b/bignum.c @@ -512,7 +512,7 @@ sexp sexp_bignum_quot_rem (sexp ctx, sexp *rem, sexp a, sexp b) { sexp_bignum_sign(b1) = 1; q = SEXP_ZERO; x = sexp_make_bignum(ctx, sexp_bignum_length(a)); - while (sexp_bignum_compare_abs(a1, b1) > 0) { /* a1, b1 at least 2 bigits */ + while (sexp_bignum_compare_abs(a1, b1) >= 0) { /* a1, b1 at least 2 bigits */ /* guess divisor x */ alen = sexp_bignum_hi(a1); sexp_bignum_data(x)[off] = 0;