(self, absfunc, test_dtype)
| 749 | |
| 750 | class TestAbs: |
| 751 | def _test_abs_func(self, absfunc, test_dtype): |
| 752 | x = test_dtype(-1.5) |
| 753 | assert_equal(absfunc(x), 1.5) |
| 754 | x = test_dtype(0.0) |
| 755 | res = absfunc(x) |
| 756 | # assert_equal() checks zero signedness |
| 757 | assert_equal(res, 0.0) |
| 758 | x = test_dtype(-0.0) |
| 759 | res = absfunc(x) |
| 760 | assert_equal(res, 0.0) |
| 761 | |
| 762 | x = test_dtype(np.finfo(test_dtype).max) |
| 763 | assert_equal(absfunc(x), x.real) |
| 764 | |
| 765 | with suppress_warnings() as sup: |
| 766 | sup.filter(UserWarning) |
| 767 | x = test_dtype(np.finfo(test_dtype).tiny) |
| 768 | assert_equal(absfunc(x), x.real) |
| 769 | |
| 770 | x = test_dtype(np.finfo(test_dtype).min) |
| 771 | assert_equal(absfunc(x), -x.real) |
| 772 | |
| 773 | @pytest.mark.parametrize("dtype", floating_types + complex_floating_types) |
| 774 | def test_builtin_abs(self, dtype): |
no test coverage detected