(self)
| 476 | self.assertEqual(abs(math.copysign(2., NAN)), 2.) |
| 477 | |
| 478 | def testCos(self): |
| 479 | self.assertRaises(TypeError, math.cos) |
| 480 | self.ftest('cos(-pi/2)', math.cos(-math.pi/2), 0, abs_tol=math.ulp(1)) |
| 481 | self.ftest('cos(0)', math.cos(0), 1) |
| 482 | self.ftest('cos(pi/2)', math.cos(math.pi/2), 0, abs_tol=math.ulp(1)) |
| 483 | self.ftest('cos(pi)', math.cos(math.pi), -1) |
| 484 | try: |
| 485 | self.assertTrue(math.isnan(math.cos(INF))) |
| 486 | self.assertTrue(math.isnan(math.cos(NINF))) |
| 487 | except ValueError: |
| 488 | self.assertRaises(ValueError, math.cos, INF) |
| 489 | self.assertRaises(ValueError, math.cos, NINF) |
| 490 | self.assertTrue(math.isnan(math.cos(NAN))) |
| 491 | |
| 492 | @unittest.skipIf(sys.platform == 'win32' and platform.machine() in ('ARM', 'ARM64'), |
| 493 | "Windows UCRT is off by 2 ULP this test requires accuracy within 1 ULP") |
nothing calls this directly
no test coverage detected