summaryrefslogtreecommitdiff
path: root/tests/basics/int_mpz.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-09-15 16:15:57 +0100
committerDamien George <damien.p.george@gmail.com>2015-09-15 16:15:57 +0100
commit8b4fb4fe140e9cf57fcfa258d0d2d6fe19090fc5 (patch)
treef37cb4277e50faa6d3116a7c9ebcb15395646caa /tests/basics/int_mpz.py
parentb230a86d332376d15b61636111ce47c90a5ab54a (diff)
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/basics/int_mpz.py')
-rw-r--r--tests/basics/int_mpz.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/basics/int_mpz.py b/tests/basics/int_mpz.py
index 6d99accf2..8c347302a 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)