summaryrefslogtreecommitdiffstats
path: root/Lib/numbers.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-09-08 11:03:53 (GMT)
committerGitHub <noreply@github.com>2022-09-08 11:03:53 (GMT)
commitae819ca6fd09e14a58842fc1e889f6737e53af0d (patch)
treeb6c2ced3a964aa8e083b3476235d31b2b99f656b /Lib/numbers.py
parente72f469e857e2e853dd067742e4c8c5f7bb8fb16 (diff)
downloadcpython-ae819ca6fd09e14a58842fc1e889f6737e53af0d.zip
cpython-ae819ca6fd09e14a58842fc1e889f6737e53af0d.tar.gz
cpython-ae819ca6fd09e14a58842fc1e889f6737e53af0d.tar.bz2
[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>
Diffstat (limited to 'Lib/numbers.py')
-rw-r--r--Lib/numbers.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/numbers.py b/Lib/numbers.py
index 5b98e64..0985dd8 100644
--- a/Lib/numbers.py
+++ b/Lib/numbers.py
@@ -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):