mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +00:00
[3.11] gh-68163: Correct conversion of Rational instances to float (GH-25619) (#96556)
Co-authored-by: Mark Dickinson <dickinsm@gmail.com> Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
This commit is contained in:
parent
e72f469e85
commit
ae819ca6fd
4 changed files with 36 additions and 4 deletions
|
@ -288,7 +288,7 @@ class Rational(Real):
|
|||
so that ratios of huge integers convert without overflowing.
|
||||
|
||||
"""
|
||||
return self.numerator / self.denominator
|
||||
return int(self.numerator) / int(self.denominator)
|
||||
|
||||
|
||||
class Integral(Rational):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue