[pypy-svn] r72286 - in pypy/branch/ll_math/pypy/rpython/lltypesystem/module: . test

arigo at codespeak.net arigo at codespeak.net
Tue Mar 16 14:17:45 CET 2010


Author: arigo
Date: Tue Mar 16 14:17:43 2010
New Revision: 72286

Modified:
   pypy/branch/ll_math/pypy/rpython/lltypesystem/module/ll_math.py
   pypy/branch/ll_math/pypy/rpython/lltypesystem/module/test/test_ll_math.py
Log:
Add log and log10, tests.


Modified: pypy/branch/ll_math/pypy/rpython/lltypesystem/module/ll_math.py
==============================================================================
--- pypy/branch/ll_math/pypy/rpython/lltypesystem/module/ll_math.py	(original)
+++ pypy/branch/ll_math/pypy/rpython/lltypesystem/module/ll_math.py	Tue Mar 16 14:17:43 2010
@@ -302,7 +302,7 @@
 unary_math_functions = [
     'acos', 'asin', 'atan',
     'ceil', 'cos', 'cosh', 'exp', 'fabs', 'floor',
-    'sin', 'sinh', 'sqrt', 'tan', 'tanh',
+    'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'log', 'log10',
     # 'log1p', 'acosh', 'asinh', 'atanh',   -- added in Python 2.6
     ]
 unary_math_functions_can_overflow = [

Modified: pypy/branch/ll_math/pypy/rpython/lltypesystem/module/test/test_ll_math.py
==============================================================================
--- pypy/branch/ll_math/pypy/rpython/lltypesystem/module/test/test_ll_math.py	(original)
+++ pypy/branch/ll_math/pypy/rpython/lltypesystem/module/test/test_ll_math.py	Tue Mar 16 14:17:43 2010
@@ -44,6 +44,8 @@
         ('exp', (9999.9,), OverflowError),
         ('pow', (10.0, 40000.0), OverflowError),
         ('ldexp', (10.0, 40000), OverflowError),
+        ('log', (0.0,), ValueError),
+        ('log10', (0.0,), ValueError),
         ]
 
     INFCASES = [
@@ -75,6 +77,10 @@
         ('tan', (-INFINITY,), ValueError),
         ('tanh', (INFINITY,), 1.0),
         ('tanh', (-INFINITY,), -1.0),
+        ('log', (INFINITY,), positiveinf),
+        ('log', (-INFINITY,), ValueError),
+        ('log10', (INFINITY,), positiveinf),
+        ('log10', (-INFINITY,), ValueError),
         ('frexp', (INFINITY,), lambda x: isinf(x[0])),
         ('ldexp', (INFINITY, 3), positiveinf),
         ('ldexp', (-INFINITY, 3), negativeinf),



More information about the Pypy-commit mailing list