From: Alex M. <al...@us...> - 2006-04-22 23:31:36
|
Update of /cvsroot/gmpy/gmpy/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17658/test Modified Files: gmpy_test_cvr.py gmpy_test_dec.py gmpy_test_mpf.py gmpy_test_mpq.py Log Message: Fix setup.py for GMP 4.2 install on MacOSX 10.4 (look in /usr/local if needed); fix gmpy.c's randoms to be backwards compatible despite 4.2's changes to randoms; tweak tests to not demand quite as much identical-precision (digit by digit) of large numbers, since some last few digits change from GMP 4.1 to GMP 4.2; accept 4.2 among the GMP versions deemed OK in _test_cvr. Index: gmpy_test_cvr.py =================================================================== RCS file: /cvsroot/gmpy/gmpy/test/gmpy_test_cvr.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** gmpy_test_cvr.py 26 Feb 2006 07:36:59 -0000 1.7 --- gmpy_test_cvr.py 22 Apr 2006 23:31:30 -0000 1.8 *************** *** 3,7 **** # test-version 1.02 r''' ! >>> print int(_g.gmp_version() in ('4.1.4', '4.1.2', '4.0.1', '3.1.1')) 1 >>> _g.version() --- 3,7 ---- # test-version 1.02 r''' ! >>> print int(_g.gmp_version() in ('4.2', '4.1.4', '4.1.2', '4.0.1', '3.1.1')) 1 >>> _g.version() Index: gmpy_test_dec.py =================================================================== RCS file: /cvsroot/gmpy/gmpy/test/gmpy_test_dec.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gmpy_test_dec.py 22 Apr 2006 16:28:19 -0000 1.1 --- gmpy_test_dec.py 22 Apr 2006 23:31:30 -0000 1.2 *************** *** 45,50 **** >>> _g.getrprec(d) 53 ! >>> _g.fsqrt(d) ! mpf('3.51283361405005916059e0') >>> coerce(d, _g.mpf(1.0)) (mpf('1.234e1'), mpf('1.e0')) --- 45,50 ---- >>> _g.getrprec(d) 53 ! >>> _g.fsqrt(d)==_g.mpf(d).sqrt() ! 1 >>> coerce(d, _g.mpf(1.0)) (mpf('1.234e1'), mpf('1.e0')) Index: gmpy_test_mpf.py =================================================================== RCS file: /cvsroot/gmpy/gmpy/test/gmpy_test_mpf.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** gmpy_test_mpf.py 26 Feb 2006 07:08:19 -0000 1.7 --- gmpy_test_mpf.py 22 Apr 2006 23:31:30 -0000 1.8 *************** *** 89,97 **** >>> _g.floor(-12.3)==math.floor(-12.3) 1 ! >>> (a**2).reldiff(float(a)**2) < (2.0**-(a.getrprec()-1)) 1 >>> (a**2).reldiff(a*a) < (2.0**-(a.getprec()-1)) 1 ! >>> (b**2).reldiff(float(b)**2) < (2.0**-(b.getrprec()-1)) 1 >>> (b**2).reldiff(b*b) < (2.0**-(b.getprec()-1)) --- 89,97 ---- >>> _g.floor(-12.3)==math.floor(-12.3) 1 ! >>> (a**2).reldiff(float(a)**2) < 1.03 * (2.0**-(a.getrprec()-1)) 1 >>> (a**2).reldiff(a*a) < (2.0**-(a.getprec()-1)) 1 ! >>> (b**2).reldiff(float(b)**2) < 1.03 * (2.0**-(b.getrprec()-1)) 1 >>> (b**2).reldiff(b*b) < (2.0**-(b.getprec()-1)) Index: gmpy_test_mpq.py =================================================================== RCS file: /cvsroot/gmpy/gmpy/test/gmpy_test_mpq.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** gmpy_test_mpq.py 26 Feb 2006 07:36:59 -0000 1.8 --- gmpy_test_mpq.py 22 Apr 2006 23:31:30 -0000 1.9 *************** *** 88,99 **** >>> 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') >>> ''' --- 88,99 ---- >>> a//b mpq(0) ! >>> truediv(a,b).digits(10,19) ! '4.205023013808284971e-2' >>> b/a mpq(39976,1681) >>> b//a mpq(23) ! >>> truediv(b,a).digits(10,19) ! '2.378108268887566924e1' >>> ''' |