diff --git a/src/hist.jl b/src/hist.jl index e625da435..a0e25e9a2 100644 --- a/src/hist.jl +++ b/src/hist.jl @@ -73,7 +73,11 @@ function histrange{F}(lo::F, hi::F, n::Integer, closed::Symbol=:right) len += one(F) end end - FloatRange(start,step,len,divisor) + @static if VERSION < v"0.6.0-dev.2376" # Julia PR 18777 + FloatRange(start,step,len,divisor) + else + Base.floatrange(start,step,len,divisor) + end end histrange{N}(vs::NTuple{N,AbstractVector},nbins::NTuple{N,Integer},closed::Symbol) = diff --git a/test/hist.jl b/test/hist.jl index 56b998013..d010de008 100644 --- a/test/hist.jl +++ b/test/hist.jl @@ -70,5 +70,5 @@ l,h = extrema(StatsBase.histrange([typemin(Int),typemax(Int)], 10)) # hist show show_h = sprint(show, fit(Histogram,[1,2,3])) @test contains(show_h, "edges:\n 0.0:1.0:3.0") -@test contains(show_h, "weights: [1,1,1]") +@test contains(show_h, string("weights: ", [1,1,1])) @test contains(show_h, "closed: right")