[Mark Dickinson <dicki...@gmail.com>]
> 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?

The principled alternative to the current "in mixed-type arithmetic
involving a float, operands are converted to float first" is "all
operations are computed internally as if with infinite precision, then
if the result is within the range of representable floats, the result
is rounded to the closest such".

But you already knew that ;-) It's a slippery slope, of scant
discernible benefit, and still hackish. For example, 10**600 / 1e200 /
1e200. If we just do the first division "as if with infinite ...", it
still blows up, despite that the computation as a whole would not if
done "as if with infinite ;...:".

Floats are not the computable reals ;-)
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/6YLJZKLRH2YQ6NJWOC573NNTMYS5TVU7/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to