summaryrefslogtreecommitdiff
path: root/numpy/core/function_base.py
diff options
context:
space:
mode:
authorRobert Pröpper <robert.proepper@gmail.com>2014-03-17 16:35:27 +0100
committerRobert Pröpper <robert.proepper@gmail.com>2014-03-18 12:33:41 +0100
commit4a764d3c7afccedc6e96fce0bdabe6ed44f255dc (patch)
treeb9ea92ecc10c4fa62060c110b135032cf28debe0 /numpy/core/function_base.py
parentb80ef7539cc91f4c78a80f425b0906f497fc1f12 (diff)
downloadnumpy-4a764d3c7afccedc6e96fce0bdabe6ed44f255dc.tar.gz
BUG: Fix linspace for use with physical quantities
The fix for issue 3504 led to errors when using linspace with the quantities package. Multiplying with 1 instead of adding 0 prevents issues when using physical quantities.
Diffstat (limited to 'numpy/core/function_base.py')
-rw-r--r--numpy/core/function_base.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/core/function_base.py b/numpy/core/function_base.py
index 6c0947cbf..400e75eb5 100644
--- a/numpy/core/function_base.py
+++ b/numpy/core/function_base.py
@@ -80,8 +80,8 @@ def linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None):
num = int(num)
# Convert float/complex array scalars to float, gh-3504
- start = start + 0.
- stop = stop + 0.
+ start = start * 1.
+ stop = stop * 1.
if dtype is None:
dtype = result_type(start, stop, float(num))