(self)
| 511 | "float(shuge) should not equal int(shuge)") |
| 512 | |
| 513 | def test_logs(self): |
| 514 | LOG10E = math.log10(math.e) |
| 515 | |
| 516 | for exp in list(range(10)) + [100, 1000, 10000]: |
| 517 | value = 10 ** exp |
| 518 | log10 = math.log10(value) |
| 519 | self.assertAlmostEqual(log10, exp) |
| 520 | |
| 521 | # log10(value) == exp, so log(value) == log10(value)/log10(e) == |
| 522 | # exp/LOG10E |
| 523 | expected = exp / LOG10E |
| 524 | log = math.log(value) |
| 525 | self.assertAlmostEqual(log, expected) |
| 526 | |
| 527 | for bad in -(1 << 10000), -2, 0: |
| 528 | self.assertRaises(ValueError, math.log, bad) |
| 529 | self.assertRaises(ValueError, math.log10, bad) |
| 530 | |
| 531 | def test_mixed_compares(self): |
| 532 | eq = self.assertEqual |
nothing calls this directly
no test coverage detected