Lines Matching refs:MyDecimal
1610 class MyDecimal(Decimal): class
1613 d1 = MyDecimal(1)
1614 d2 = MyDecimal(2)
1722 class MyDecimal(Decimal): class
1725 r = MyDecimal.from_float(0.1)
1726 self.assertEqual(type(r), MyDecimal)
1730 self.assertEqual(MyDecimal.from_float(bigint), MyDecimal(bigint))
1731 self.assertTrue(MyDecimal.from_float(float('nan')).is_qnan())
1732 self.assertTrue(MyDecimal.from_float(float('inf')).is_infinite())
1733 self.assertTrue(MyDecimal.from_float(float('-inf')).is_infinite())
1734 self.assertEqual(str(MyDecimal.from_float(float('nan'))),
1736 self.assertEqual(str(MyDecimal.from_float(float('inf'))),
1738 self.assertEqual(str(MyDecimal.from_float(float('-inf'))),
1740 self.assertRaises(TypeError, MyDecimal.from_float, 'abc')
1743 self.assertEqual(x, float(MyDecimal.from_float(x))) # roundtrip