M
Marco
In Python 3, when we hava a division and both the result and at least
one operand are too large to convert to float, we get an exception:
Traceback (most recent call last):
File "<input>", line 1, in <module>
OverflowError: long int too large to convert to float
When the result is inside the limits, we get the right value:
3.511119404027961e+305
Why the behavior is different in the case of the multiplication?
Traceback (most recent call last):
File "<input>", line 1, in <module>
OverflowError: long int too large to convert to float
I think the multiplication should have the same behavior than the
division:
* `inf` or `-inf` when the operands are inside the limits,
but the result is not
* `OverflowError` when the result, and at least one operand,
are out of range.
one operand are too large to convert to float, we get an exception:
Traceback (most recent call last):
File "<input>", line 1, in <module>
OverflowError: long int too large to convert to float
When the result is inside the limits, we get the right value:
3.511119404027961e+305
Why the behavior is different in the case of the multiplication?
Traceback (most recent call last):
File "<input>", line 1, in <module>
OverflowError: long int too large to convert to float
I think the multiplication should have the same behavior than the
division:
* `inf` or `-inf` when the operands are inside the limits,
but the result is not
* `OverflowError` when the result, and at least one operand,
are out of range.