summaryrefslogtreecommitdiff
path: root/scipy/base/scimath.py
diff options
context:
space:
mode:
Diffstat (limited to 'scipy/base/scimath.py')
-rw-r--r--scipy/base/scimath.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/scipy/base/scimath.py b/scipy/base/scimath.py
index 99fe112d5..18d75b2df 100644
--- a/scipy/base/scimath.py
+++ b/scipy/base/scimath.py
@@ -16,6 +16,8 @@ from type_check import isreal
__all__.extend([key for key in dir(_nx.umath) \
if key[0]!='_' and key not in __all__])
+_ln2 = log(2.0)
+
def _tocomplex(arr):
if arr.dtypechar in ['f', 'h', 'B', 'b','H']:
return arr.astype('F')
@@ -57,7 +59,7 @@ def log2(x):
""" Take log base 2 of x.
"""
x = _fix_real_lt_zero(x)
- return log(x)/log(2)
+ return log(x)/_ln2
def power(x, p):
x = _fix_real_lt_zero(x)