Staging
v0.5.1
https://github.com/python/cpython
Revision 4cd6f2ab807e0f3a23a059a407a08c5edad6bb98 authored by Greg Ward on 14 October 2000, 03:56:42 UTC, committed by Greg Ward on 14 October 2000, 03:56:42 UTC
1 parent 0b4dafc
Raw File
Tip revision: 4cd6f2ab807e0f3a23a059a407a08c5edad6bb98 authored by Greg Ward on 14 October 2000, 03:56:42 UTC
Bastian Kleineidam: make 'check_lib()' more like AC_CHECK_LIB by adding
Tip revision: 4cd6f2a
test_cmath.py
#! /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)
back to top