Mercurial > cpython-lru_cache-weakref
view Lib/test/test_cmath.py @ 5817:48b94de85bf3 legacy-trunk
Extensive changes by AMK.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Thu, 17 Jul 1997 16:29:42 +0000 |
| parents | db230fefa702 |
| children | aedd2d0dcb31 |
line wrap: on
line source
#! /usr/bin/env python """ Simple test script for cmathmodule.c Roger E. Masse """ import cmath from test_support import verbose testdict = {'acos' : 1.0, 'acosh' : 1.0, 'asin' : 1.0, 'asinh' : 1.0, 'atan' : 0.2, 'atanh' : 0.2, 'cos' : 1.0, 'cosh' : 1.0, 'exp' : 1.0, 'log' : 1.0, 'log10' : 1.0, 'sin' : 1.0, 'sinh' : 1.0, 'sqrt' : 1.0, 'tan' : 1.0, 'tanh' : 1.0} for func in testdict.keys(): f = getattr(cmath, func) r = f(testdict[func]) if verbose: print 'Calling %s(%f) = %f' % (func, testdict[func], abs(r)) p = cmath.pi e = cmath.e if verbose: print 'PI = ', abs(p) print 'E = ', abs(e)
