-
-
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
unwise new rational/float promotion rules #3378
Comments
It looks like this is a disastrous overflow that occurs from the ill-advised promotion rules implemented for #3102. See also the mailing list. Basically, any My feeling is that promote(float,rational) should give float. Transitivity be damned, this is way worse. |
#3382 mitigates a subset of these problems, including the example above. It has no effect on other expressions though, like julia> (0.1 * 1//1)^2
-Inf so it doesn't substantially change the situation. |
After reading through the comments on commit 6125749, I think this issue arises from confusing two different problems from a user perspective:
I think the possibility to do 2. is a good goal, but not at the cost of predictability in 1. Rather than using the |
Revert promotion behavior of rationals with floating-point values to behavior prior to 6125749 and 24dbefc, i.e. floating-point wins. Also includes a couple of promotion tweaks for MathConsts. See discussion at https://groups.google.com/forum/?fromgroups#!searchin/julia-dev/rational/julia-dev/2JcZdFKisis/Ag9rBJrrqQQJ
whereas
float64(e * (1//2)) - e/2
works (and gives0.0
).This seems like a bug to me. See also commit 24dbefc. @StefanKarpinski?
The text was updated successfully, but these errors were encountered: