
Feb. 20, 2022
7:59 a.m.
Mark Dickinson wrote:
Unrelated question: under this proposal, what would you want `Fraction(10**400) / 1e200` to do? Should it also produce a `float` approximation to 1e200, or is it okay for it to raise `OverflowError` as it currently does?
Somehow that sounds like a trick question :-). I'd say 1e200, yes, although didn't think much about it. Btw the full error message I get for that is "OverflowError: integer division result too large for a float". Even for `Fraction(10**400, 3) / 3.14`. Saying "integer division" when neither operand is an integer and I'm also not using `//` feels suboptimal.