(self)
| 2602 | """ Tests for math.fma. """ |
| 2603 | |
| 2604 | def test_fma_nan_results(self): |
| 2605 | # Selected representative values. |
| 2606 | values = [ |
| 2607 | -math.inf, -1e300, -2.3, -1e-300, -0.0, |
| 2608 | 0.0, 1e-300, 2.3, 1e300, math.inf, math.nan |
| 2609 | ] |
| 2610 | |
| 2611 | # If any input is a NaN, the result should be a NaN, too. |
| 2612 | for a, b in itertools.product(values, repeat=2): |
| 2613 | with self.subTest(a=a, b=b): |
| 2614 | self.assertIsNaN(math.fma(math.nan, a, b)) |
| 2615 | self.assertIsNaN(math.fma(a, math.nan, b)) |
| 2616 | self.assertIsNaN(math.fma(a, b, math.nan)) |
| 2617 | |
| 2618 | def test_fma_infinities(self): |
| 2619 | # Cases involving infinite inputs or results. |
nothing calls this directly
no test coverage detected