diff options
author | Sebastian Berg <sebastianb@nvidia.com> | 2023-01-24 11:56:44 +0100 |
---|---|---|
committer | Sebastian Berg <sebastianb@nvidia.com> | 2023-01-24 11:56:44 +0100 |
commit | 781235a5ef9db9d68782c03b9288567882919ef9 (patch) | |
tree | cf384eb8edf489e7057e124bed17244c584b9ca9 /numpy/array_api/_array_object.py | |
parent | 172a1942893b5ce55abccd836fdd9f00235a6767 (diff) | |
download | numpy-781235a5ef9db9d68782c03b9288567882919ef9.tar.gz |
BUG: Fix `integer / float` scalar promotion
Integer true division converted the other type directly to the output.
This is correct if both operands are integers, but since the output
of integer division is double precision, it is incorrect when the
other operand is a float32 or float16.
The solution is that we must convert to the same type (as always)
and only the output type is adjusted, but not the inputs.
This means that `integer / float` will correctly defer to the float
which leads to correct promotion.
Diffstat (limited to 'numpy/array_api/_array_object.py')
0 files changed, 0 insertions, 0 deletions