summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_math.py
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2010-06-13 10:50:29 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2010-06-13 10:50:29 (GMT)
commite979ec8fbf873efc266e665ae946df30dea97f6e (patch)
treeb7874d842ee46fc829ea31fe335dd284fd42945d /Lib/test/test_math.py
parent8842c356aa98869e3d80b10cad5d5aeee22d5569 (diff)
downloadcpython-e979ec8fbf873efc266e665ae946df30dea97f6e.zip
cpython-e979ec8fbf873efc266e665ae946df30dea97f6e.tar.gz
cpython-e979ec8fbf873efc266e665ae946df30dea97f6e.tar.bz2
Issue #8986: erfc was raising OverflowError on Linux for arguments in
the (approximate) range (-27.3, 30.0), as a result of an escaped errno value.
Diffstat (limited to 'Lib/test/test_math.py')
-rw-r--r--Lib/test/test_math.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_math.py b/Lib/test/test_math.py
index 36f6847..3049ef1 100644
--- a/Lib/test/test_math.py
+++ b/Lib/test/test_math.py
@@ -996,6 +996,15 @@ class MathTests(unittest.TestCase):
accuracy_failure = acc_check(expected, got,
rel_err = 5e-15,
abs_err = 5e-15)
+ elif fn == 'erfc':
+ # erfc has less-than-ideal accuracy for large
+ # arguments (x ~ 25 or so), mainly due to the
+ # error involved in computing exp(-x*x).
+ #
+ # XXX Would be better to weaken this test only
+ # for large x, instead of for all x.
+ accuracy_failure = ulps_check(expected, got, 2000)
+
else:
accuracy_failure = ulps_check(expected, got, 20)
if accuracy_failure is None: