[pypy-svn] r76099 - in pypy/branch/fast-forward/pypy/module/math: . test

benjamin at codespeak.net benjamin at codespeak.net
Sat Jul 10 19:55:40 CEST 2010


Author: benjamin
Date: Sat Jul 10 19:55:39 2010
New Revision: 76099

Modified:
   pypy/branch/fast-forward/pypy/module/math/interp_math.py
   pypy/branch/fast-forward/pypy/module/math/test/test_direct.py
Log:
fix log of negatives

Modified: pypy/branch/fast-forward/pypy/module/math/interp_math.py
==============================================================================
--- pypy/branch/fast-forward/pypy/module/math/interp_math.py	(original)
+++ pypy/branch/fast-forward/pypy/module/math/interp_math.py	Sat Jul 10 19:55:39 2010
@@ -228,7 +228,7 @@
         base = _get_double(space, w_base)
         if base <= 0.0:
             # just for raising the proper errors
-            return math1(space, math.log, base)
+            return math1(space, math.log, w_base)
     return _log_any(space, w_x, base)
 log.unwrap_spec = [ObjSpace, W_Root, W_Root]
 

Modified: pypy/branch/fast-forward/pypy/module/math/test/test_direct.py
==============================================================================
--- pypy/branch/fast-forward/pypy/module/math/test/test_direct.py	(original)
+++ pypy/branch/fast-forward/pypy/module/math/test/test_direct.py	Sat Jul 10 19:55:39 2010
@@ -55,6 +55,7 @@
         ('pow', (10.0, 40000.0), OverflowError),
         ('ldexp', (10.0, 40000), OverflowError),
         ('log', (0.0,), ValueError),
+        ('log', (-1.,), ValueError),
         ('log10', (0.0,), ValueError),
         ]
 



More information about the Pypy-commit mailing list