(self)
| 2697 | self.assertIs(int(Decimal(x)), x) |
| 2698 | |
| 2699 | def test_trunc(self): |
| 2700 | Decimal = self.decimal.Decimal |
| 2701 | |
| 2702 | for x in range(-250, 250): |
| 2703 | s = '%0.2f' % (x / 100.0) |
| 2704 | # should work the same as for floats |
| 2705 | self.assertEqual(int(Decimal(s)), int(float(s))) |
| 2706 | # should work the same as to_integral in the ROUND_DOWN mode |
| 2707 | d = Decimal(s) |
| 2708 | r = d.to_integral(ROUND_DOWN) |
| 2709 | self.assertEqual(Decimal(math.trunc(d)), r) |
| 2710 | |
| 2711 | def test_from_float(self): |
| 2712 |
nothing calls this directly
no test coverage detected