10000 gh-82017: Support as_integer_ratio() in the Fraction constructor by serhiy-storchaka · Pull Request #120271 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-82017: Support as_integer_ratio() in the Fraction constructor #120271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update Doc/library/fractions.rst
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
  • Loading branch information
serhiy-storchaka and skirpichev authored Jul 9, 2024
commit 68bb174517969840feca4755686309359607a4b4
2 changes: 2 additions & 0 deletions Doc/library/fractions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ another rational number, or from a string.
of :class:`numbers.Number` and has the :meth:`~as_integer_ratio` method
(this includes :class:`float` and :class:`decimal.Decimal`).
It returns a :class:`Fraction` instance with exactly the same value.
Assumed, that the :meth:`~as_integer_ratio` method returns a pair
of coprime integers and last one is positive.
Note that due to the
usual issues with binary floating-point (see :ref:`tut-fp-issues`), the
argument to ``Fraction(1.1)`` is not exactly equal to 11/10, and so
Expand Down
0