Skip to content

Commit

Permalink
FloatRange: work around for #5885 – temporarily move colon defintion
Browse files Browse the repository at this point in the history
Obviously we don't want to leave things like this, but with this
work around, we can merge the FloatRange branch and figure out the
root cause of #5885 later.
  • Loading branch information
StefanKarpinski committed Feb 24, 2014
1 parent 0e0e1d9 commit 75efb44
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 0 additions & 6 deletions base/range.jl
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,6 @@ function frange{T<:FloatingPoint}(start::T, step::T, stop::T)
start, step, one(step), floor(r)+1
end

colon{T<:FloatingPoint}(start::T, step::T, stop::T) =
step == 0 ? error("step cannot be zero in colon syntax") :
start == stop ? FloatRange{T}(start,step,1,1) :
(0 < step) != (start < stop) ? FloatRange{T}(start,step,1,0) :
FloatRange{T}(frange(start,step,stop)...)

similar(r::Ranges, T::Type, dims::Dims) = Array(T, dims)

length(r::Ranges) = integer(r.len)
Expand Down
7 changes: 7 additions & 0 deletions base/sysimg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ include("cartesian.jl")
using .Cartesian
include("multidimensional.jl")

# FIXME: #5885
colon{T<:FloatingPoint}(start::T, step::T, stop::T) =
step == 0 ? error("step cannot be zero in colon syntax") :
start == stop ? FloatRange{T}(start,step,1,1) :
(0 < step) != (start < stop) ? FloatRange{T}(start,step,1,0) :
FloatRange{T}(frange(start,step,stop)...)

# core math functions
include("floatfuncs.jl")
include("math.jl")
Expand Down

0 comments on commit 75efb44

Please sign in to comment.