(dtype)
| 2814 | |
| 2815 | @pytest.mark.parametrize("dtype", np.typecodes["AllFloat"]) |
| 2816 | def test_addition_negative_zero(dtype): |
| 2817 | dtype = np.dtype(dtype) |
| 2818 | if dtype.kind == "c": |
| 2819 | neg_zero = dtype.type(complex(-0.0, -0.0)) |
| 2820 | else: |
| 2821 | neg_zero = dtype.type(-0.0) |
| 2822 | |
| 2823 | arr = np.array(neg_zero) |
| 2824 | arr2 = np.array(neg_zero) |
| 2825 | |
| 2826 | assert _check_neg_zero(arr + arr2) |
| 2827 | # In-place ops may end up on a different path (reduce path) see gh-21211 |
| 2828 | arr += arr2 |
| 2829 | assert _check_neg_zero(arr) |
| 2830 | |
| 2831 | |
| 2832 | @pytest.mark.parametrize("dtype", np.typecodes["AllFloat"]) |
nothing calls this directly
no test coverage detected