Export to GitHub

gmpy - issue #2

mpz problem in gmpy-1.02


Posted on Dec 29, 2007 by Swift Kangaroo

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.

Attachments

Comment #1

Posted on May 22, 2008 by Grumpy Wombat

I verified that this issue is fixed by revision r17 in the svn tree.

casevh

Comment #2

Posted on May 23, 2008 by Grumpy Wombat

Fixed by revision r17.

Mark it fixed this time.

casevh

Status: Fixed

Labels:
Type-Defect Priority-Medium