summaryrefslogtreecommitdiff
path: root/numpy/linalg/linalg.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2017-08-06 17:22:20 -0500
committerGitHub <noreply@github.com>2017-08-06 17:22:20 -0500
commit91b06c021319faccb008a8ee485d26ae227bf079 (patch)
tree7195085d6bcaec87b5f2f0629c14456fcfa53d11 /numpy/linalg/linalg.py
parentf307cec3962926558b6387ebb4ab8d3f4ea3aa34 (diff)
parent351fe979580ab842cc5c04e1b616d3a64936a695 (diff)
downloadnumpy-91b06c021319faccb008a8ee485d26ae227bf079.tar.gz
Merge pull request #9522 from eric-wieser/stop-using-obj2sctype
BUG: Fix problems with obj2sctype
Diffstat (limited to 'numpy/linalg/linalg.py')
-rw-r--r--numpy/linalg/linalg.py13
1 files changed, 1 insertions, 12 deletions
diff --git a/numpy/linalg/linalg.py b/numpy/linalg/linalg.py
index 0f1966a9b..cd8999785 100644
--- a/numpy/linalg/linalg.py
+++ b/numpy/linalg/linalg.py
@@ -2201,18 +2201,7 @@ def norm(x, ord=None, axis=None, keepdims=False):
ord + 1
except TypeError:
raise ValueError("Invalid norm order for vectors.")
- if x.dtype.type is longdouble:
- # Convert to a float type, so integer arrays give
- # float results. Don't apply asfarray to longdouble arrays,
- # because it will downcast to float64.
- absx = abs(x)
- else:
- absx = x if isComplexType(x.dtype.type) else asfarray(x)
- if absx.dtype is x.dtype:
- absx = abs(absx)
- else:
- # if the type changed, we can safely overwrite absx
- abs(absx, out=absx)
+ absx = abs(x)
absx **= ord
return add.reduce(absx, axis=axis, keepdims=keepdims) ** (1.0 / ord)
elif len(axis) == 2: