From: Alex M. <al...@us...> - 2003-12-30 09:21:20
|
Update of /cvsroot/gmpy/gmpy/test In directory sc8-pr-cvs1:/tmp/cvs-serv27759/test Modified Files: gmpy_test_mpf.py Log Message: Fixed bug in gmpy.fbinary(0), added unit tests to catch such bugs. Index: gmpy_test_mpf.py =================================================================== RCS file: /cvsroot/gmpy/gmpy/test/gmpy_test_mpf.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gmpy_test_mpf.py 8 Aug 2003 09:48:57 -0000 1.2 --- gmpy_test_mpf.py 30 Dec 2003 09:21:16 -0000 1.3 *************** *** 289,301 **** 1 >>> _g.fbinary(0) ! '\x085\x00\x00\x00\x00\x00\x00\x00' >>> _g.fbinary(0.5) '\x085\x00\x00\x00\x00\x00\x00\x00\x80' >>> _g.fbinary(-0.5) '\t5\x00\x00\x00\x00\x00\x00\x00\x80' >>> _g.fbinary(-2.0) '\t5\x00\x00\x00\x01\x00\x00\x00\x02' >>> _g.fbinary(2.0) '\x085\x00\x00\x00\x01\x00\x00\x00\x02' >>> prec=_g.set_minprec(0) >>> junk=_g.set_minprec(prec) --- 289,311 ---- 1 >>> _g.fbinary(0) ! '\x04' ! >>> _g.mpf(_g.fbinary(0), 0, 256) == 0 ! 1 >>> _g.fbinary(0.5) '\x085\x00\x00\x00\x00\x00\x00\x00\x80' + >>> _g.mpf(_g.fbinary(0.5), 0, 256) == 0.5 + 1 >>> _g.fbinary(-0.5) '\t5\x00\x00\x00\x00\x00\x00\x00\x80' + >>> _g.mpf(_g.fbinary(-0.5), 0, 256) == -0.5 + 1 >>> _g.fbinary(-2.0) '\t5\x00\x00\x00\x01\x00\x00\x00\x02' + >>> _g.mpf(_g.fbinary(-2.0), 0, 256) == -2.0 + 1 >>> _g.fbinary(2.0) '\x085\x00\x00\x00\x01\x00\x00\x00\x02' + >>> _g.mpf(_g.fbinary(2.0), 0, 256) == 2.0 + 1 >>> prec=_g.set_minprec(0) >>> junk=_g.set_minprec(prec) |