Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix in Range constructor

before the fix:

julia> (1:3:10) - 0.5
no method Range(Float64,Int64,Int64)
 in method_missing at base.jl:60
 in - at range.jl:130

after:

julia> (1:3:10) - 0.5
0.5:3.0:9.5
  • Loading branch information...
commit 368c7e1677d3a0d58842504c6e5f66655b3c587a 1 parent 76c102a
@carlobaldassi carlobaldassi authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  base/range.jl
View
3  base/range.jl
@@ -16,8 +16,9 @@ type Range{T<:Real} <: Ranges{T}
new(start, step, len)
end
Range(start::T, step::T, len::Integer) = Range(start, step, int(len))
+ Range(start::T, step, len::Integer) = Range(start, convert(T,step), int(len))
end
-Range{T}(start::T, step::T, len::Integer) = Range{T}(start, step, len)
+Range{T}(start::T, step, len::Integer) = Range{T}(start, step, len)
type Range1{T<:Real} <: Ranges{T}
start::T
Please sign in to comment.
Something went wrong with that request. Please try again.