Skip to content

Commit

Permalink
TST: polyval NEP 50 return type test
Browse files Browse the repository at this point in the history
  • Loading branch information
luxedo committed May 24, 2024
1 parent 39fc96a commit 8e431a6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions numpy/lib/tests/test_polynomial.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,3 +301,13 @@ def test_poly_coeffs_mutable(self):
# this never used to be allowed - let's not add features to deprecated
# APIs
assert_raises(AttributeError, setattr, p, 'coeffs', np.array(1))

def test_polyval_return_types(self):
v = np.polyval(np.array([5.], dtype=np.float32), 5.0)
assert_equal(v.dtype, np.float32)

v = np.polyval(np.array([5.], dtype=np.float16), 5.0)
assert_equal(v.dtype, np.float16)

v = np.polyval([5.], np.float16(5.0))
assert_equal(v.dtype, np.float64)

0 comments on commit 8e431a6

Please sign in to comment.