Skip to content

Commit

Permalink
Updated Range Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kamalojasv181 authored Jan 22, 2020
1 parent b9de759 commit 2f133bb
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions base/range.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,8 @@ 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 numeric `length` and `stop` values are provided but `step` is not specified, the return value is
a [`StepRangeLen`](@ref) with a computed step. However, for non-numeric values of
`start` and `stop` (such as arrays), the `range` function instead returns a
[`LinRange`](@ref) object. (Both `StepRangeLen` and `LinRange` correspond
to equally spaced points up to roundoff errors, but deal with floating-point rounding
slightly differently.)
# Example
```jldoctest
julia> range([1,2], [3,4], length=10)
10-element LinRange{Array{Int64,1}}:
[1.0, 2.0],[1.22222, 2.22222],…,[2.77778, 3.77778],[3.0, 4.0]
```
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.
`stop` may be specified as either a positional or keyword argument.
Expand Down

0 comments on commit 2f133bb

Please sign in to comment.