Home
last modified time | relevance | path

Searched refs:as_integer_ratio (Results 1 – 25 of 27) sorted by relevance

12

/external/python/cpython3/Lib/
Dfractions.py108 self._numerator, self._denominator = numerator.as_integer_ratio()
179 return cls(*f.as_integer_ratio())
191 return cls(*dec.as_integer_ratio())
193 def as_integer_ratio(self): member in Fraction
Dstatistics.py232 return x.as_integer_ratio()
239 return x.as_integer_ratio()
Ddatetime.py690 a, b = other.as_integer_ratio()
718 a, b = other.as_integer_ratio()
D_pydecimal.py705 n, d = abs(f).as_integer_ratio()
976 def as_integer_ratio(self): member in Decimal
/external/python/cpython2/Lib/test/
Dtest_float.py234 self.assertEqual(f.as_integer_ratio(), ratio)
239 n, d = f.as_integer_ratio()
244 R(*float(0.0).as_integer_ratio()))
246 R(*float(2.5).as_integer_ratio()))
248 R(*float(0.5).as_integer_ratio()))
250 R(*float(2.1).as_integer_ratio()))
252 R(*float(-2.1).as_integer_ratio()))
254 R(*float(-2100.0).as_integer_ratio()))
256 self.assertRaises(OverflowError, float('inf').as_integer_ratio)
257 self.assertRaises(OverflowError, float('-inf').as_integer_ratio)
[all …]
/external/python/cpython3/Lib/test/
Dtest_float.py258 self.assertEqual(f.as_integer_ratio(), ratio)
263 n, d = f.as_integer_ratio()
268 R(*float(0.0).as_integer_ratio()))
270 R(*float(2.5).as_integer_ratio()))
272 R(*float(0.5).as_integer_ratio()))
274 R(*float(2.1).as_integer_ratio()))
276 R(*float(-2.1).as_integer_ratio()))
278 R(*float(-2100.0).as_integer_ratio()))
280 self.assertRaises(OverflowError, float('inf').as_integer_ratio)
281 self.assertRaises(OverflowError, float('-inf').as_integer_ratio)
[all …]
Dtest_fractions.py282 self.assertEqual(F(4, 6).as_integer_ratio(), (2, 3))
283 self.assertEqual(F(-4, 6).as_integer_ratio(), (-2, 3))
284 self.assertEqual(F(4, -6).as_integer_ratio(), (-2, 3))
285 self.assertEqual(F(0, 6).as_integer_ratio(), (0, 1))
Dtest_decimal.py2072 Decimal.as_integer_ratio, Decimal('inf'))
2074 Decimal.as_integer_ratio, Decimal('-inf'))
2076 Decimal.as_integer_ratio, Decimal('-nan'))
2078 Decimal.as_integer_ratio, Decimal('snan123'))
2084 pq = d.as_integer_ratio()
5458 def as_integer_ratio(self): member in CWhitebox.test_internal_use_of_overridden_methods.X
5472 def as_integer_ratio(self): member in CWhitebox.test_internal_use_of_overridden_methods.Z
Dtest_long.py1368 numerator, denominator = value.as_integer_ratio()
/external/python/cpython3/Doc/tutorial/
Dfloatingpoint.rst166 :meth:`float.as_integer_ratio` method expresses the value of a float as a
170 >>> x.as_integer_ratio()
293 >>> (0.1).as_integer_ratio()
/external/python/cpython3/Doc/library/
Dfractions.rst101 .. method:: as_integer_ratio()
Ddecimal.rst459 .. method:: as_integer_ratio()
465 >>> Decimal('-3.14').as_integer_ratio()
Dstdtypes.rst543 .. method:: int.as_integer_ratio()
558 .. method:: float.as_integer_ratio()
726 return hash_fraction(*x.as_integer_ratio())
/external/python/cpython2/Lib/
Dfractions.py182 return cls(*f.as_integer_ratio())
Ddecimal.py690 n, d = abs(f).as_integer_ratio()
/external/python/cpython3/Misc/NEWS.d/
D3.7.0a2.rst232 float with a bad as_integer_ratio() method. Patch by Oren Milman.
D3.6.4rc1.rst234 float with a bad as_integer_ratio() method. Patch by Oren Milman.
D3.6.0a1.rst1004 Make use of new Decimal.as_integer_ratio() method in statistics module.
2143 Add Decimal.as_integer_ratio().
D3.9.0a1.rst2223 Add Fraction.as_integer_ratio() to match the corresponding methods in bool,
/external/python/cpython3/Doc/whatsnew/
D3.6.rst999 New :meth:`Decimal.as_integer_ratio() <decimal.Decimal.as_integer_ratio>`
1004 >>> Decimal('-3.14').as_integer_ratio()
D2.6.rst1462 the float type now has an :meth:`as_integer_ratio()` method that returns
1466 >>> (2.5) .as_integer_ratio()
1468 >>> (3.1415) .as_integer_ratio()
1470 >>> (1./3) .as_integer_ratio()
D3.8.rst391 now have an :meth:`~int.as_integer_ratio` method like that found in
394 x.as_integer_ratio()`` and have it work across multiple numeric types.
/external/python/cpython2/Doc/whatsnew/
D2.6.rst1458 the float type now has an :meth:`as_integer_ratio()` method that returns
1462 >>> (2.5) .as_integer_ratio()
1464 >>> (3.1415) .as_integer_ratio()
1466 >>> (1./3) .as_integer_ratio()
/external/python/cpython3/Modules/
D_datetimemodule.c142 _Py_IDENTIFIER(as_integer_ratio);
/external/python/cpython2/Doc/library/
Dstdtypes.rst515 .. method:: float.as_integer_ratio()

12