wangtongada / gmpy

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

Error in gmpy.qbinary when encoding a zero value #27

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
a = 0
total = gmpy.mpq(a)
print 'total ', total
>> total  0

a = gmpy.qbinary(total)
print 'a = ', gmpy.mpq(a,256)
>> a =  88

a = total.binary()
print 'a = ', gmpy.mpq(a,256)
>> a =  176

Platform: Windows XP, SP3
Python 2.5
gmpy-1.04.win32-py2.5.exe

Original issue reported on code.google.com by runar.te...@gmail.com on 1 Jun 2009 at 9:48

GoogleCodeExporter commented 8 years ago
Thanks for the bug report. I found the issue and I'm testing a fix. BTW, the 
bug also
impacts binary(mpz(0)).

Original comment by casevh on 3 Jun 2009 at 5:55

GoogleCodeExporter commented 8 years ago
This is fixed in gmpy 1.10. There will be an alpha release in the next few days.

Original comment by casevh on 5 Jul 2009 at 5:11