repo.or.cz
/
python
/
dscho.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
append(): Fixing the test for convertability after consultation with
[python/dscho.git]
/
Lib
/
test
/
test_cmath.py
blob
c4096993b6c7d5c26487fd06130c8b1618de3f4f
1
#! /usr/bin/env python
2
""" Simple test script for cmathmodule.c
3
Roger E. Masse
4
"""
5
import
cmath
6
from
test
.
test_support
import
verbose
7
8
testdict
= {
'acos'
:
1.0
,
9
'acosh'
:
1.0
,
10
'asin'
:
1.0
,
11
'asinh'
:
1.0
,
12
'atan'
:
0.2
,
13
'atanh'
:
0.2
,
14
'cos'
:
1.0
,
15
'cosh'
:
1.0
,
16
'exp'
:
1.0
,
17
'log'
:
1.0
,
18
'log10'
:
1.0
,
19
'sin'
:
1.0
,
20
'sinh'
:
1.0
,
21
'sqrt'
:
1.0
,
22
'tan'
:
1.0
,
23
'tanh'
:
1.0
}
24
25
for
func
in
testdict
.
keys
():
26
f
=
getattr
(
cmath
,
func
)
27
r
=
f
(
testdict
[
func
])
28
if
verbose
:
29
print
'Calling
%s
(
%f
) =
%f
'
% (
func
,
testdict
[
func
],
abs
(
r
))
30
31
p
=
cmath
.
pi
32
e
=
cmath
.
e
33
if
verbose
:
34
print
'PI = '
,
abs
(
p
)
35
print
'E = '
,
abs
(
e
)