-
Notifications
You must be signed in to change notification settings - Fork 45
Bugfix in overflow, CartesianIndices for BigInt ranges #227
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #227 +/- ##
==========================================
- Coverage 99.04% 94.33% -4.71%
==========================================
Files 5 5
Lines 314 318 +4
==========================================
- Hits 311 300 -11
- Misses 3 18 +15
Continue to review full report at Codecov.
|
Test failure on nightly is probably a breakage. JuliaLang/julia#40035 Can be fixed by defining the conversion of an |
4eebd90 fixes overflow checks to use the axes and not the offset (which is usually an Before: julia> OffsetArray(1:big(2)^65, 4000)
ERROR: OverflowError: offset should be <= -27670116110564327425 corresponding to the axis Base.OneTo(36893488147419103232), received an offset 4000 Now: julia> OffsetArray(1:big(2)^65, 4000)
1:36893488147419103232 with indices 4001:36893488147419107232 |
Whoops I committed the offsetranges.jl file by mistake |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand it correctly, except for the compat patch for JuliaLang/julia#40038, this PR is ready? So far it looks good to me.
Yes this is ready |
src/axes.jl
Outdated
AbstractUnitRange{T}(r::IdOffsetRange{T}) where T<:Integer = r | ||
AbstractUnitRange{T}(r::IdOffsetRange) where T<:Integer = IdOffsetRange{T}(r) | ||
|
||
OrdinalRange{T,T}(r::IdOffsetRange) where {T<:Integer} = AbstractUnitRange{T}(r) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps add a comment to JuliaLang/julia#40038 so that people know this can be removed in future Julia versions.
There was a bug introduced by #226 , this PR fixes that.
On master:
After this PR:
Also fixes a bug in
CartesianIndices
caused by a missing method forIdOffsetRange
. This is broken on master anyway because of the previous bug, so we need to fix that to see this. After adding the fix:After this PR: