Home
last modified time | relevance | path

Searched refs:from_decimal (Results 1 – 8 of 8) sorted by relevance

/external/python/cpython2/Lib/test/
Dtest_fractions.py277 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/
Dtest_fractions.py277 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/
Dfractions.py115 value = Fraction.from_decimal(numerator)
185 def from_decimal(cls, dec): member in Fraction
/external/python/cpython2/Doc/library/
Dfractions.rst98 .. method:: from_decimal(dec)
/external/python/cpython3/Doc/library/
Dfractions.rst109 .. method:: from_decimal(dec)
/external/python/cpython3/Lib/
Dfractions.py208 def from_decimal(cls, dec): member in Fraction
/external/python/cpython2/Misc/NEWS.d/
D2.6b2.rst234 Fractions from_float() and from_decimal() accept Integral arguments.
/external/python/cpython3/Doc/whatsnew/
D3.2.rst1321 :meth:`~fractions.Fraction.from_float()` and :meth:`~fractions.Fraction.from_decimal`