[pypy-commit] pypy default: no bonus points for trying too hard
mattip
noreply at buildbot.pypy.org
Thu Dec 13 23:16:30 CET 2012
Author: mattip <matti.picus at gmail.com>
Branch:
Changeset: r59412:10fd78f2d11c
Date: 2012-12-13 14:16 -0800
http://bitbucket.org/pypy/pypy/changeset/10fd78f2d11c/
Log: no bonus points for trying too hard
diff --git a/pypy/module/math/test/test_direct.py b/pypy/module/math/test/test_direct.py
--- a/pypy/module/math/test/test_direct.py
+++ b/pypy/module/math/test/test_direct.py
@@ -72,10 +72,10 @@
('exp', (9999.9,), OverflowError),
('pow', (10.0, 40000.0), OverflowError),
('ldexp', (10.0, 40000), OverflowError),
- ('log', (0.0,), OverflowError),
+ ('log', (0.0,), ValueError), #cpython does it this way
('log1p', (-1.0,), OverflowError),
('log', (-1.,), ValueError),
- ('log10', (0.0,), OverflowError),
+ ('log10', (0.0,), ValueError), #cpython does it this way
]
INFCASES = [
diff --git a/pypy/rpython/lltypesystem/module/ll_math.py b/pypy/rpython/lltypesystem/module/ll_math.py
--- a/pypy/rpython/lltypesystem/module/ll_math.py
+++ b/pypy/rpython/lltypesystem/module/ll_math.py
@@ -356,15 +356,11 @@
def ll_math_log(x):
if x <= 0:
- if x == 0:
- raise OverflowError("math range error")
raise ValueError("math domain error")
return math_log(x)
def ll_math_log10(x):
if x <= 0:
- if x == 0:
- raise OverflowError("math range error")
raise ValueError("math domain error")
return math_log10(x)
More information about the pypy-commit
mailing list