summaryrefslogtreecommitdiff
path: root/numpy/f2py/docs/usersguide/setup_example.py
diff options
context:
space:
mode:
authorLars Buitinck <larsmans@gmail.com>2013-12-26 14:12:53 +0100
committerLars Buitinck <larsmans@gmail.com>2013-12-26 14:12:53 +0100
commitdff072619643c6d668446b229d44b7e4d45e6ec0 (patch)
tree81150b775318a245c5c85aa4b41e615eb39c70ae /numpy/f2py/docs/usersguide/setup_example.py
parent61998c22df08e7ec0938bedef931ac824cfb634a (diff)
downloadnumpy-dff072619643c6d668446b229d44b7e4d45e6ec0.tar.gz
BUG: linalg: norm fails on longdouble, signed int
This fixes the following bug with longdouble: >>> x = np.arange(10, dtype=np.longdouble) >>> np.linalg.norm(x, ord=3) Traceback (most recent call last): File "<ipython-input-5-7ee53a8ac142>", line 1, in <module> np.linalg.norm(x, ord=3) File "/tmp/v/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 2090, in norm return add.reduce(absx**ord, axis=axis)**(1.0/ord) UnboundLocalError: local variable 'absx' referenced before assignment As well as the handling of minimal values for signed integers: >>> x = np.array([-2**31], dtype=np.int32) >>> np.linalg.norm(x, ord=3) /tmp/v/lib/python2.7/site-packages/numpy/linalg/linalg.py:2090: RuntimeWarning: invalid value encountered in double_scalars return add.reduce(absx**ord, axis=axis)**(1.0/ord) nan
Diffstat (limited to 'numpy/f2py/docs/usersguide/setup_example.py')
0 files changed, 0 insertions, 0 deletions