mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-32968: Make modulo and floor division involving Fraction and float consistent with other operations (#5956)
Make mixed-type `%` and `//` operations involving `Fraction` and `float` objects behave like all other mixed-type arithmetic operations: first the `Fraction` object is converted to a `float`, then the `float` operation is performed as normal. This fixes some surprising corner cases, like `Fraction('1/3') % inf` giving a NaN. Thanks Elias Zamaria for the patch.
This commit is contained in:
parent
74734f73ca
commit
393f1ff62e
4 changed files with 13 additions and 12 deletions
|
@ -1814,6 +1814,7 @@ Masazumi Yoshikawa
|
|||
Arnaud Ysmal
|
||||
Bernard Yue
|
||||
Moshe Zadka
|
||||
Elias Zamaria
|
||||
Milan Zamazal
|
||||
Artur Zaprzala
|
||||
Mike Zarnstorff
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue