-
-
Notifications
You must be signed in to change notification settings - Fork 29.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Python 3 behavior: Divide by zero with no exceptions
You can track the idea at https://discuss.python.org/t/python-3-behavior-divide-by-zero-with-no-exceptions/25615 The idea is: + Return inf (known as positive infinity) when the numerator is larger than 0. + Return -inf (known as negative infinity) when the numerator is smaller than 0. Some problems in dividing by zero: + 0/0 is undefined, since it’s because the conflict in calculating of limitation of equation when x approach 0. The exception is still returned + i/0 (where i is the imaginary number) is undefined. The exception is still returned Dividing a integer, no matter whether it is negative or positive, the result always returns inf. No exception is thrown.
- Loading branch information
TheFlightSimsOfficial
committed
Apr 13, 2023
1 parent
d034590
commit b0508f3
Showing
3 changed files
with
45 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters