-
-
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
Revised Range Documentation #34475
Revised Range Documentation #34475
Conversation
@@ -53,11 +53,20 @@ Given a starting value, construct a range either by length or from `start` to `s | |||
optionally with a given step (defaults to 1, a [`UnitRange`](@ref)). | |||
One of `length` or `stop` is required. If `length`, `stop`, and `step` are all specified, they must agree. | |||
|
|||
If `length` and `stop` are provided and `step` is not, the step size will be computed | |||
automatically such that there are `length` linearly spaced elements in the range (a [`LinRange`](@ref)). |
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.
To me it would be clearer to keep the
the step size will be computed automatically such that there are
length
linearly spaced elements in the range
part because it's important and applies to everything. Then say something like
"""
...in a range. The returned type depends on the inputs, a [`StepRangeLen`](@ref) for floating-point inputs and [`LinRange`](@ref) otherwise.
"""
because that's effectively a detail that most people won't need to worry about. (Since the docs for StepRangeLen
mention error-free arithmetic, I think we're covered as far as "purpose" goes.)
Yes, deleting the info about return type seems like an OK solution to the problem too. Any other thoughts? |
Oh I thought you meant doing that in the first place. Anyways I think it would be great to do so for now. |
Well, there don't seem to be any objections to just deleting the info about the return type. If you can clean up this branch with the extraneous stuff then I think we could merge it. |
Sorry for the trouble. Now we are back at where you want. It is ready to be merged. |
Thanks @kamalojasv181! |
Closes #33798