Skip to content

Commit

Permalink
ENH: real and conj accept numeric dtypes
Browse files Browse the repository at this point in the history
  • Loading branch information
ev-br committed Feb 7, 2025
1 parent 590a2de commit b18a1b6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions array_api_strict/_elementwise_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,8 @@ def conj(x: Array, /) -> Array:
See its docstring for more information.
"""
if x.dtype not in _complex_floating_dtypes:
raise TypeError("Only complex floating-point dtypes are allowed in conj")
if x.dtype not in _numeric_dtypes:
raise TypeError("Only numeric dtypes are allowed in conj")
return Array._new(np.conj(x._array), device=x.device)


Expand Down Expand Up @@ -568,8 +568,8 @@ def real(x: Array, /) -> Array:
See its docstring for more information.
"""
if x.dtype not in _complex_floating_dtypes:
raise TypeError("Only complex floating-point dtypes are allowed in real")
if x.dtype not in _numeric_dtypes:
raise TypeError("Only numeric dtypes are allowed in real")
return Array._new(np.real(x._array), device=x.device)


Expand Down

0 comments on commit b18a1b6

Please sign in to comment.