-
-
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
Julia v1.7: Multiplication broken with BigInt
ranges
#41517
Comments
The PR that changed this is #40320 One quick solution would be to only use _steprangelength(a, st, n::Int) = StepRangeLen(a, st, n)
_steprangelength(a, st, n) = range(a; step=st, length=n)
broadcasted(::DefaultArrayStyle{1}, ::typeof(*), x::Number, r::AbstractRange) = _steprangelength(x*first(r), x*step(r), length(r)) |
That's a pity, we wondered if there would be edge cases. Re "only use Do many other things assume
|
Note the related commit that fixed many of these issues: #37741 I ran into this particular problem in InfiniteArrays.jl, where the length of the array is infinite. This has become an accepted use case: I believe I can work around this particular issue as-is, albeit Though I have to say I don't understand why you didn't change |
From triage:
|
Also be more careful about using additive identity instead of multiplicitive, and be more consistent about types in a few places. Fixes #41517
Also be more careful about using additive identity instead of multiplicative, and be more consistent about types in a few places. Fixes #41517
Also be more careful about using additive identity instead of multiplicative, and be more consistent about types in a few places. Fixes #41517
Allows creating these ranges for any type of integer lengths. Also need to be careful about using additive identity instead of multiplicative, and be even more consistent now about types in a few places. Fixes #41517
In Julia v1.7-beta:
Previously:
The issue is that
StepRangeLen
only allowsInt
lengths.The text was updated successfully, but these errors were encountered: