-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rational multiplication 0 * Inf results in DivideError #39638
Comments
This is definitely intentional, although it might deserve a better error message. Note that the corresponding floating point computation |
Thanks for the background @simeonschaub . We were generally hoping that the |
That's generally not something that's possible in a consistent way if you decide to include +/- infinity as well. In practice, I would think that you can often just ignore the existence of these infinities or explicitly check against them. |
0 * Inf = 0 definitely seems like bad math. Consider |
I see, yeah I realize that in our system maybe the problem is that infinity should not have been allowed to begin with. The Rational type chooses to support infinity as a special value, but I probably didn't want that. The mathematical properties I had in mind seem okay if you exclude infinity. |
The problem is that the gcd is 0 with
x.num
andy.den
both being0
For any
x
, I think an appropriate value for0 * x
would be 0?The text was updated successfully, but these errors were encountered: