diff options
author | Damien George <damien.p.george@gmail.com> | 2014-05-12 23:27:29 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-05-12 23:27:29 +0100 |
commit | 561e42590307efd3f279e903e599f3894080a4df (patch) | |
tree | eb757f2d8861679fb605d7419fe3a438bf6329a9 /py | |
parent | cc97446ca588d15e67cc126035802e183fab70a9 (diff) | |
download | micropython-561e42590307efd3f279e903e599f3894080a4df.tar.gz micropython-561e42590307efd3f279e903e599f3894080a4df.zip |
py: Fix bug in mpz_and function.
Addresses issue #610.
Diffstat (limited to 'py')
-rw-r--r-- | py/mpz.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -213,8 +213,8 @@ STATIC uint mpn_and(mpz_dig_t *idig, const mpz_dig_t *jdig, uint jlen, const mpz *idig = *jdig & *kdig; } - for (; jlen > 0; --jlen, ++idig) { - *idig = 0; + // remove trailing zeros + for (; idig > oidig && *idig == 0; --idig) { } return idig - oidig; |