[pypy-svn] r14106 - pypy/branch/dist-2.4.1/pypy/lib

ac at codespeak.net ac at codespeak.net
Sat Jul 2 18:30:07 CEST 2005


Author: ac
Date: Sat Jul  2 18:30:07 2005
New Revision: 14106

Modified:
   pypy/branch/dist-2.4.1/pypy/lib/cmath.py
Log:
Support second argument to cmath.log().

Modified: pypy/branch/dist-2.4.1/pypy/lib/cmath.py
==============================================================================
--- pypy/branch/dist-2.4.1/pypy/lib/cmath.py	(original)
+++ pypy/branch/dist-2.4.1/pypy/lib/cmath.py	Sat Jul  2 18:30:07 2005
@@ -115,11 +115,13 @@
     return complex(real, imag)
 
 
-def log(x):
+def log(x, base=None):
     """log(x)
 
     Return the natural logarithm of x."""
     
+    if base is not None:
+        return log(x) / log(base)
     x = complex(x, 0)
     l = math.hypot(x.real,x.imag)
     imag = math.atan2(x.imag, x.real)



More information about the Pypy-commit mailing list