-
Notifications
You must be signed in to change notification settings - Fork 10
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
InfStepRange is not an ordinal range #109
Comments
I'm trying to change the definition to struct InfStepRange{T,S} <: AbstractRange{T}
start::T
step::S
end Hopefully additional small fixes could pass all tests. |
Perhaps this should be an |
For float input, as for how julia base works, it should return an InfStepRangeLen then. Julia base never generates a StepRange of float type. But from the implementation perspective, StepRange and InfStepRange work in the same way as |
Yes, that might make sense for the colon constructor. Ideally, the infinite types should shadow the finite ones |
The motivation of this issue is julia> 1.0:∞
1.0:1.0:+∞
julia> float(1:∞)
1.0:∞ while julia> 1.0:5
1.0:1.0:5.0
julia> float(1:5)
1.0:1.0:5.0 |
well maybe InfiniteArrays is correct while Julia base is not |
I don't think the types are considered a part of correctness. The resulting values are the same in each case, with the types in |
Infinite float ranges are definitely important, as operators are often float valued (think of even the Derivative operator for Chebyshev but on a mapped interval) |
See JuliaArrays/FillArrays.jl#207
Currently,
InfStepRange
is too permissive:If this is an ordinal range, the step size should be limited to multiples of
oneunit
. Perhaps the current design is accidental, rather than the intention, and the start and step should be integers?The text was updated successfully, but these errors were encountered: