diff options
author | Omar <Omarh90@gmail.com> | 2022-07-04 12:09:54 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-04 21:09:54 +0200 |
commit | cf39a723ef4cac328225fd0e3a9b83edac41c2c1 (patch) | |
tree | dc495119abe9ce5bb6ceffbef0a7834e0740ff19 /numpy/core/numeric.py | |
parent | 353fea031dacf2c31399cc938f545cfcfdc9c57c (diff) | |
download | numpy-cf39a723ef4cac328225fd0e3a9b83edac41c2c1.tar.gz |
BUG: cross product: add dtype conversions of inputs (#20659)
Closes #19138
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r-- | numpy/core/numeric.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index d6e1d4eec..cfcd237aa 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -1622,6 +1622,10 @@ def cross(a, b, axisa=-1, axisb=-1, axisc=-1, axis=None): dtype = promote_types(a.dtype, b.dtype) cp = empty(shape, dtype) + # recast arrays as dtype + a = a.astype(dtype) + b = b.astype(dtype) + # create local aliases for readability a0 = a[..., 0] a1 = a[..., 1] |