summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_math.py
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2009-12-16 20:23:42 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2009-12-16 20:23:42 (GMT)
commit664b511c0acdfdecdec92d2255ffd94c4e6d5f7a (patch)
tree075cdf8651d66f24e42c1b87e57e7423e3e7a9d3 /Lib/test/test_math.py
parentef1992b9fbcfb1dae7e946bfc42403fcaae9f044 (diff)
downloadcpython-664b511c0acdfdecdec92d2255ffd94c4e6d5f7a.zip
cpython-664b511c0acdfdecdec92d2255ffd94c4e6d5f7a.tar.gz
cpython-664b511c0acdfdecdec92d2255ffd94c4e6d5f7a.tar.bz2
Merged revisions 76861 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r76861 | mark.dickinson | 2009-12-16 20:13:40 +0000 (Wed, 16 Dec 2009) | 3 lines Issue #3366: Add expm1 function to math module. Thanks Eric Smith for testing on Windows. ........
Diffstat (limited to 'Lib/test/test_math.py')
-rw-r--r--Lib/test/test_math.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/Lib/test/test_math.py b/Lib/test/test_math.py
index 2052430..5ae5d3a 100644
--- a/Lib/test/test_math.py
+++ b/Lib/test/test_math.py
@@ -984,17 +984,16 @@ class MathTests(unittest.TestCase):
if math.isnan(expected) and math.isnan(got):
continue
if not math.isnan(expected) and not math.isnan(got):
- # we use different closeness criteria for
- # different functions.
- if fn == 'gamma':
- accuracy_failure = ulps_check(expected, got, 20)
- elif fn == 'lgamma':
+ if fn == 'lgamma':
+ # we use a weaker accuracy test for lgamma;
+ # lgamma only achieves an absolute error of
+ # a few multiples of the machine accuracy, in
+ # general.
accuracy_failure = acc_check(expected, got,
rel_err = 5e-15,
abs_err = 5e-15)
else:
- raise ValueError("don't know how to check accuracy "
- "for this function")
+ accuracy_failure = ulps_check(expected, got, 20)
if accuracy_failure is None:
continue