mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #25928: Add Decimal.as_integer_ratio(). Python parts and docs by
Mark Dickinson.
This commit is contained in:
parent
ac1e7f6983
commit
53f2e0ad45
7 changed files with 213 additions and 3 deletions
|
@ -70,6 +70,15 @@ PyDoc_STRVAR(doc_as_tuple,
|
|||
Return a tuple representation of the number.\n\
|
||||
\n");
|
||||
|
||||
PyDoc_STRVAR(doc_as_integer_ratio,
|
||||
"as_integer_ratio($self, /)\n--\n\n\
|
||||
Decimal.as_integer_ratio() -> (int, int)\n\
|
||||
\n\
|
||||
Return a pair of integers, whose ratio is exactly equal to the original\n\
|
||||
Decimal and with a positive denominator. The ratio is in lowest terms.\n\
|
||||
Raise OverflowError on infinities and a ValueError on NaNs.\n\
|
||||
\n");
|
||||
|
||||
PyDoc_STRVAR(doc_canonical,
|
||||
"canonical($self, /)\n--\n\n\
|
||||
Return the canonical encoding of the argument. Currently, the encoding\n\
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue