Skip to content

Commit

Permalink
fix in Range constructor
Browse files Browse the repository at this point in the history
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
carlobaldassi committed Apr 15, 2012
1 parent 76c102a commit 368c7e1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion base/range.jl
Expand Up @@ -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
Expand Down

0 comments on commit 368c7e1

Please sign in to comment.