~ chicken-core (chicken-5) e99d29f3fbe5c56971b35fae7d7c819cc18fb4b6
commit e99d29f3fbe5c56971b35fae7d7c819cc18fb4b6 Author: Peter Bex <peter@more-magic.net> AuthorDate: Sun Jun 4 12:44:13 2017 +0200 Commit: Peter Bex <peter@more-magic.net> CommitDate: Sun Jun 4 12:44:13 2017 +0200 Fix previous commit; the shift should be for an unsigned value diff --git a/runtime.c b/runtime.c index 5b0fa049..50f62599 100644 --- a/runtime.c +++ b/runtime.c @@ -9866,9 +9866,9 @@ bignum_destructive_divide_normalized(C_word big_u, C_word big_v, C_word big_q) rhat = hat % vn_1; /* Two whiles is faster than one big check with an OR. Thanks, Gauche! */ - while(qhat >= ((C_word)1 << C_BIGNUM_HALF_DIGIT_LENGTH)) { qhat--; rhat += vn_1; } + while(qhat >= ((C_uword)1 << C_BIGNUM_HALF_DIGIT_LENGTH)) { qhat--; rhat += vn_1; } while(qhat * vn_2 > C_BIGNUM_DIGIT_COMBINE(rhat, C_uhword_ref(u, j+n-2)) - && rhat < ((C_word)1 << C_BIGNUM_HALF_DIGIT_LENGTH)) { + && rhat < ((C_uword)1 << C_BIGNUM_HALF_DIGIT_LENGTH)) { qhat--; rhat += vn_1; }Trap