andyvand / gmpy

Automatically exported from code.google.com/p/gmpy
GNU Lesser General Public License v3.0
0 stars 0 forks source link

mpz problem in gmpy-1.02 #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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.

Original issue reported on code.google.com by rel...@osagesoftware.com on 29 Dec 2007 at 6:10

Attachments:

GoogleCodeExporter commented 9 years ago
I verified that this issue is fixed by revision r17 in the svn tree.

casevh

Original comment by casevh on 22 May 2008 at 5:44

GoogleCodeExporter commented 9 years ago
Fixed by revision r17.

Mark it fixed this time.

casevh

Original comment by casevh on 23 May 2008 at 4:14