Skip to content

Commit

Permalink
Use fld in _colon method in range.jl (#48654)
Browse files Browse the repository at this point in the history
  • Loading branch information
garrison committed Feb 14, 2023
1 parent 48572af commit ff6a3cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/range.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
_colon(::Ordered, ::Any, start::T, step, stop::T) where {T} = StepRange(start, step, stop)
# for T<:Union{Float16,Float32,Float64} see twiceprecision.jl
_colon(::Ordered, ::ArithmeticRounds, start::T, step, stop::T) where {T} =
StepRangeLen(start, step, floor(Integer, (stop-start)/step)+1)
StepRangeLen(start, step, convert(Integer, fld(stop - start, step)) + 1)
_colon(::Any, ::Any, start::T, step, stop::T) where {T} =
StepRangeLen(start, step, floor(Integer, (stop-start)/step)+1)
StepRangeLen(start, step, convert(Integer, fld(stop - start, step)) + 1)

"""
(:)(start, [step], stop)
Expand Down

0 comments on commit ff6a3cf

Please sign in to comment.