Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
When indexing a FloatRange with a OrdinalRange, you have to be careful to use the actual r.step, instead of step(r) = r.step/r.divisor.
  • Loading branch information
ivarne committed Jun 26, 2014
1 parent 670a6a1 commit db31364
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/range.jl
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ end

function getindex(r::FloatRange, s::OrdinalRange)
0 < last(s) <= length(r) || throw(BoundsError())
FloatRange(r[first(s)],step(r)*step(s),length(s),r.divisor)
FloatRange(r[first(s)], r.step*step(s),length(s),r.divisor)
end

function show(io::IO, r::Range)
Expand Down

0 comments on commit db31364

Please sign in to comment.