Describe the issue:
The Array API spec requires __add__(), and by extension __iadd__(), to output a negative 0 when both operands are negative 0. NumPy currently follows this special case for __add__(), but not for __iadd__(). cc @asmeurer
(I'll have a look at fixing this later.)
Reproduce the code example:
In [4]: x1 = xp.asarray(-0.)
In [5]: x2 = xp.asarray(-0.)
In [6]: x1 + x2
Out[6]: Array(-0., dtype=float64)
In [7]: x1 += x2
In [8]: x1
Out[8]: Array(0., dtype=float64) # should be -0.
Error message:
No response
NumPy/Python version information:
1.22.3 3.8.12 (default, Mar 13 2022, 19:12:08)
[GCC 9.4.0]