From: Alex M. <al...@us...> - 2005-11-07 21:04:42
|
Update of /cvsroot/gmpy/gmpy/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7947 Modified Files: gmpy_test.py gmpy_test_mpf.py gmpy_test_mpq.py gmpy_test_mpz.py Added Files: gmpy_truediv.py Log Message: Added tests for truediv and floordiv. --- NEW FILE: gmpy_truediv.py --- from __future__ import division def truediv(a, b): return a/b Index: gmpy_test.py =================================================================== RCS file: /cvsroot/gmpy/gmpy/test/gmpy_test.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gmpy_test.py 6 Nov 2005 03:14:41 -0000 1.4 --- gmpy_test.py 7 Nov 2005 21:04:31 -0000 1.5 *************** *** 20,29 **** test_modules = (gmpy_test_cvr, gmpy_test_rnd, gmpy_test_mpf, ! gmpy_test_mpq, gmpy_test_mpz ) _g = gmpy print "Unit tests for gmpy 1.01 release candidate" ! print " on Python",sys.version print "Testing gmpy %s (GMP %s), default caching (%s, %s, %s..%s)" % ( (_g.version(), _g.gmp_version(), _g.get_zcache(), _g.get_qcache(), --- 20,29 ---- test_modules = (gmpy_test_cvr, gmpy_test_rnd, gmpy_test_mpf, ! gmpy_test_mpq, gmpy_test_mpz, ) _g = gmpy print "Unit tests for gmpy 1.01 release candidate" ! print " on Python", sys.version print "Testing gmpy %s (GMP %s), default caching (%s, %s, %s..%s)" % ( (_g.version(), _g.gmp_version(), _g.get_zcache(), _g.get_qcache(), Index: gmpy_test_mpf.py =================================================================== RCS file: /cvsroot/gmpy/gmpy/test/gmpy_test_mpf.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gmpy_test_mpf.py 23 Dec 2004 08:11:14 -0000 1.4 --- gmpy_test_mpf.py 7 Nov 2005 21:04:31 -0000 1.5 *************** *** 125,128 **** --- 125,147 ---- ''' + from gmpy_truediv import truediv + __test__['newdiv']=\ + r''' + >>> + >>> a/b + mpf('1.56447093799065544915e-1') + >>> a//b + mpf('0.e0') + >>> truediv(a,b) + mpf('1.56447093799065544915e-1') + >>> b/a + mpf('6.39193720839813374806e0') + >>> b//a + mpf('6.e0') + >>> truediv(b,a) + mpf('6.39193720839813374806e0') + >>> + ''' + __test__['cmpr']=\ r''' Index: gmpy_test_mpq.py =================================================================== RCS file: /cvsroot/gmpy/gmpy/test/gmpy_test_mpq.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gmpy_test_mpq.py 7 Nov 2005 00:43:55 -0000 1.4 --- gmpy_test_mpq.py 7 Nov 2005 21:04:31 -0000 1.5 *************** *** 81,84 **** --- 81,102 ---- ''' + from gmpy_truediv import truediv + __test__['newdiv']=\ + r''' + >>> a/b + mpq(1681,39976) + >>> a//b + mpq(0) + >>> truediv(a,b) + mpf('4.20502301380828497101e-2') + >>> b/a + mpq(39976,1681) + >>> b//a + mpq(23) + >>> truediv(b,a) + mpf('2.37810826888756692443e1') + >>> + ''' + __test__['cmpr']=\ r''' Index: gmpy_test_mpz.py =================================================================== RCS file: /cvsroot/gmpy/gmpy/test/gmpy_test_mpz.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** gmpy_test_mpz.py 7 Nov 2005 19:21:16 -0000 1.7 --- gmpy_test_mpz.py 7 Nov 2005 21:04:31 -0000 1.8 *************** *** 100,103 **** --- 100,121 ---- ''' + from gmpy_truediv import truediv + __test__['newdiv']=\ + r''' + >>> a/b + mpz(0) + >>> a//b + mpz(0) + >>> truediv(a,b) + mpf('2.69736842105263157895e-1') + >>> b/a + mpz(3) + >>> b//a + mpz(3) + >>> truediv(b,a) + mpf('3.70731707317073170732e0') + >>> + ''' + __test__['cmpr']=\ r''' |