-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
modint example is broken #102
Comments
The fallback |
When did that change? Why not convert the integer 0 instead of the float 0.0? |
@andreasnoackjensen changed it since calls like |
Limiting zero to numbers seems reasonable but changing it to Float64 seems unnecessary. |
Logically, if you can convert a Float64 to some type, then you can convert an Int to that type too, but the converse does not hold at all. |
Yeah, I think I'm ok with changing it back to an Int. |
JuliaLang/julia#6183 specifically changed the default to
|
See also JuliaLang/julia#4808 |
The previous behavior that we've had forever worked very well for almost all scalar situations. This was introduced and started breaking code within an hour. Let's make an actual discussion with examples of various problematic situations for defaulting to |
The motivating example was something like
and I want to find the return type of
but
and therefore
In the pull request, I advertised that the change could break code with type inference problems, but there I mainly thought about the An alternative to reverting could have been
|
That may be ok, but I'm not entirely convinced that Float64 is really the right default for non-integer reals – that's problematic for Rationals, for example. |
I have thought a little more about this. Using |
I agree that the current situation is problematic but I don't think defaulting to Float64 instead of Int is a real solution (we're in agreement). Since that doesn't really fix the matter, I'd rather not break code. |
Some recent change to linear algebra dispatch broke the classic ModInt example. We should probably go ahead and make that a test just so that we don't break it. It seems that now multiplication of ModInt matrices ends up using generic_matmatmul which expects zero to be defined for the element type.
The text was updated successfully, but these errors were encountered: