Skip to content

Commit

Permalink
Fix tests for Boolean.
Browse files Browse the repository at this point in the history
  • Loading branch information
teoliphant committed Dec 24, 2006
1 parent 3fa7474 commit 0410265
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions numpy/lib/tests/test_ufunclike.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
Test isposinf, isneginf, sign
>>> a = nx.array([nx.Inf, -nx.Inf, nx.NaN, 0.0, 3.0, -3.0])
>>> U.isposinf(a)
array([True, False, False, False, False, False], dtype=bool)
array([ True, False, False, False, False, False], dtype=bool)
>>> U.isneginf(a)
array([False, True, False, False, False, False], dtype=bool)
array([False, True, False, False, False, False], dtype=bool)
>>> olderr = nx.seterr(invalid='ignore')
>>> nx.sign(a)
array([ 1., -1., 0., 0., 1., -1.])
Expand All @@ -29,19 +29,19 @@
Same thing with an output array:
>>> y = nx.zeros(a.shape, bool)
>>> U.isposinf(a, y)
array([True, False, False, False, False, False], dtype=bool)
array([ True, False, False, False, False, False], dtype=bool)
>>> y
array([True, False, False, False, False, False], dtype=bool)
array([ True, False, False, False, False, False], dtype=bool)
>>> U.isneginf(a, y)
array([False, True, False, False, False, False], dtype=bool)
array([False, True, False, False, False, False], dtype=bool)
>>> y
array([False, True, False, False, False, False], dtype=bool)
array([False, True, False, False, False, False], dtype=bool)
>>> olderr = nx.seterr(invalid='ignore')
>>> nx.sign(a, y)
array([True, True, False, False, True, True], dtype=bool)
array([ True, True, False, False, True, True], dtype=bool)
>>> olderr = nx.seterr(**olderr)
>>> y
array([True, True, False, False, True, True], dtype=bool)
array([ True, True, False, False, True, True], dtype=bool)
Now log2:
>>> a = nx.array([4.5, 2.3, 6.5])
Expand Down

0 comments on commit 0410265

Please sign in to comment.