What steps will reproduce the problem?
Running the attached python program demonstrates gmpy.mpz() producing incorrect values for integer inputs near 2**32.
Using version 1.0.2 on 64-bit gentoo with AMD64 X2 processor
Old environment: 32-bit gentoo on AMD Athlon XP New environment: 64-bit gentoo on AMD64 X2
In the old environment, gmpy.mpz() works correctly. In the new environment it produces incorrect results for integer values near 2**32, i.e. 4294967296.
Specifically for values from 2**32 - 2 to 2**32 + 9, gmpy.mpz( ) subtracts 2**32 from the value and produces results of -2 to +9.
Integer values below 2**32-2 and above 2**32+9 are processed correctly.
Using longs, rather than ints, produces correct results.
- test_gmpy_int_vs_long.py 1.15KB
- test_gmpy_int_vs_long.out 1.09KB
Comment #1
Posted on May 22, 2008 by Grumpy WombatI verified that this issue is fixed by revision r17 in the svn tree.
casevh
Comment #2
Posted on May 23, 2008 by Grumpy WombatFixed by revision r17.
Mark it fixed this time.
casevh
Status: Fixed
Labels:
Type-Defect
Priority-Medium