-
-
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
Infinite recursion in div for Real #33651
Comments
Yes, the removal of the fallback was deliberate. It was widely inaccurate for various types we had. FixedPointDecimals should provide this method for its particular type. Of course we should fix this to give a better error. |
Also, I don't think this is a regression, at least not as stated. Three argument |
also a better compatibility fallback to two-argument div for packages that haven't upgraded yet. Fixes #33651
also a better compatibility fallback to two-argument div for packages that haven't upgraded yet. Fixes #33651
also a better compatibility fallback to two-argument div for packages that haven't upgraded yet. Fixes #33651
Ah, @Keno, it turns out that there was actually a regression, since the default implementation of julia> let x = FixedDecimal{Int,2}(1)
x ÷ 2
end
ERROR: StackOverflowError:
Stacktrace:
[1] div(::FixedDecimal{Int64,2}, ::FixedDecimal{Int64,2}, ::RoundingMode{:ToZero}) at ./div.jl:234 (repeats 79998 times) But your new fallback definition in #33679 does indeed fix the regression, so thanks! :) julia> let x = FixedDecimal{Int,2}(1)
x ÷ 2
end
FixedDecimal{Int64,2}(0.00) ✅ |
Yeah, I saw that after making that comment and testing my fixed so I fixed it right along the original issue. |
#33040 caused this
The fallback
div
definition used to apply toT <: Real
but is now forT <: AbstractFloat
, which leaves out types such asFixedPointDecimal
. This causes an infinitepromote
recursion.The text was updated successfully, but these errors were encountered: