That sounds like a lot of extra checks to put on "/" when the error message is clear and the user could implement their own checks if they are running into this niche use case and do 10**400 / int(1e200). Damian (he/him) On Sat, Feb 19, 2022 at 8:36 AM Stefan Pochmann <smpochmann@gmail.com> wrote:
It crashes because it tries to convert 10**400 to a float and that fails:
10**400 / 1e200 Traceback (most recent call last): File "<pyshell#10>", line 1, in <module> 10**400 / 1e200 OverflowError: int too large to convert to float
But with two ints it succeeds:
10**400 / 10**200 1e+200
Note that 1e200 is an integer:
1e200.is_integer() True
So that could losslessly be converted to int, and then the division would succeed:
10**400 / int(1e200) 1e+200
So could/should 10**400 / 1e200 be implemented to do that instead of raising the error? Or is it a too rare use case and not worth the effort, or does something else speak against it? _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-leave@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/O7FE5A... Code of Conduct: http://python.org/psf/codeofconduct/