(self)
| 2695 | """ Tests for math.fma. """ |
| 2696 | |
| 2697 | def test_fma_nan_results(self): |
| 2698 | # Selected representative values. |
| 2699 | values = [ |
| 2700 | -math.inf, -1e300, -2.3, -1e-300, -0.0, |
| 2701 | 0.0, 1e-300, 2.3, 1e300, math.inf, math.nan |
| 2702 | ] |
| 2703 | |
| 2704 | # If any input is a NaN, the result should be a NaN, too. |
| 2705 | for a, b in itertools.product(values, repeat=2): |
| 2706 | with self.subTest(a=a, b=b): |
| 2707 | self.assertIsNaN(math.fma(math.nan, a, b)) |
| 2708 | self.assertIsNaN(math.fma(a, math.nan, b)) |
| 2709 | self.assertIsNaN(math.fma(a, b, math.nan)) |
| 2710 | |
| 2711 | def test_fma_infinities(self): |
| 2712 | # Cases involving infinite inputs or results. |
nothing calls this directly
no test coverage detected