Skip to content

Commit 27c8f60

Browse files
Update LinRange example to comply with Julia > v1.6 (#41478)
* Update `LinRange` example to comply with Julia > v1.6 * converts example to doctest Co-authored-by: Johnny Chen <[email protected]> Co-authored-by: Johnny Chen <[email protected]>
1 parent 42d8105 commit 27c8f60

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

base/range.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,17 +465,17 @@ julia> LinRange(1.5, 5.5, 9)
465465
466466
Compared to using [`range`](@ref), directly constructing a `LinRange` should
467467
have less overhead but won't try to correct for floating point errors:
468-
```julia
468+
```jldoctest
469469
julia> collect(range(-0.1, 0.3, length=5))
470-
5-element Array{Float64,1}:
470+
5-element Vector{Float64}:
471471
-0.1
472472
0.0
473473
0.1
474474
0.2
475475
0.3
476476
477477
julia> collect(LinRange(-0.1, 0.3, 5))
478-
5-element Array{Float64,1}:
478+
5-element Vector{Float64}:
479479
-0.1
480480
-1.3877787807814457e-17
481481
0.09999999999999999

0 commit comments

Comments
 (0)