Searched refs:from_decimal (Results 1 – 8 of 8) sorted by relevance
/external/python/cpython2/Lib/test/ |
D | test_fractions.py | 277 self.assertRaises(TypeError, F.from_decimal, 3+4j) 278 self.assertEqual(F(10, 1), F.from_decimal(10)) 279 self.assertEqual(F(0), F.from_decimal(Decimal("-0"))) 280 self.assertEqual(F(5, 10), F.from_decimal(Decimal("0.5"))) 281 self.assertEqual(F(5, 1000), F.from_decimal(Decimal("5e-3"))) 282 self.assertEqual(F(5000), F.from_decimal(Decimal("5e3"))) 284 F.from_decimal(Decimal("0." + "9" * 30))) 288 F.from_decimal, Decimal("inf")) 291 F.from_decimal, Decimal("-inf")) 294 F.from_decimal, Decimal("nan")) [all …]
|
/external/python/cpython3/Lib/test/ |
D | test_fractions.py | 277 self.assertRaises(TypeError, F.from_decimal, 3+4j) 278 self.assertEqual(F(10, 1), F.from_decimal(10)) 279 self.assertEqual(F(0), F.from_decimal(Decimal("-0"))) 280 self.assertEqual(F(5, 10), F.from_decimal(Decimal("0.5"))) 281 self.assertEqual(F(5, 1000), F.from_decimal(Decimal("5e-3"))) 282 self.assertEqual(F(5000), F.from_decimal(Decimal("5e3"))) 284 F.from_decimal(Decimal("0." + "9" * 30))) 289 F.from_decimal, Decimal("inf")) 292 F.from_decimal, Decimal("-inf")) 295 F.from_decimal, Decimal("nan")) [all …]
|
/external/python/cpython2/Lib/ |
D | fractions.py | 115 value = Fraction.from_decimal(numerator) 185 def from_decimal(cls, dec): member in Fraction
|
/external/python/cpython2/Doc/library/ |
D | fractions.rst | 98 .. method:: from_decimal(dec)
|
/external/python/cpython3/Doc/library/ |
D | fractions.rst | 109 .. method:: from_decimal(dec)
|
/external/python/cpython3/Lib/ |
D | fractions.py | 208 def from_decimal(cls, dec): member in Fraction
|
/external/python/cpython2/Misc/NEWS.d/ |
D | 2.6b2.rst | 234 Fractions from_float() and from_decimal() accept Integral arguments.
|
/external/python/cpython3/Doc/whatsnew/ |
D | 3.2.rst | 1321 :meth:`~fractions.Fraction.from_float()` and :meth:`~fractions.Fraction.from_decimal`
|