diff options
author | Damien George <damien.p.george@gmail.com> | 2015-09-15 16:15:57 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-09-15 16:15:57 +0100 |
commit | 8b4fb4fe140e9cf57fcfa258d0d2d6fe19090fc5 (patch) | |
tree | f37cb4277e50faa6d3116a7c9ebcb15395646caa /tests | |
parent | b230a86d332376d15b61636111ce47c90a5ab54a (diff) | |
download | micropython-8b4fb4fe140e9cf57fcfa258d0d2d6fe19090fc5.tar.gz micropython-8b4fb4fe140e9cf57fcfa258d0d2d6fe19090fc5.zip |
py/mpz: Fix calculation of max digit storage for mpz; fix sys.maxsize.
When creating constant mpz's, the length of the mpz must be exactly how
many digits are used (not allocated) otherwise these numbers are not
compatible with dynamically allocated numbers.
Addresses issue #1448.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/basics/int_mpz.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/basics/int_mpz.py b/tests/basics/int_mpz.py index 6d99accf27..8c347302a5 100644 --- a/tests/basics/int_mpz.py +++ b/tests/basics/int_mpz.py @@ -77,3 +77,7 @@ x = 4611686018427387903 # small x = -4611686018427387903 # small x = 4611686018427387904 # big x = -4611686018427387904 # big + +# sys.maxsize is a constant mpz, so test it's compatible with dynamic ones +import sys +print(sys.maxsize + 1 - 1 == sys.maxsize) |