The following issue might surprise newcomers to Julia
julia> y1 = [1:3;]
3-element Array{Int64,1}:
1
2
3
julia> y1[3] = y1[3] + 5.0
8.0
julia> y1[3] = y1[3] + 4.99
ERROR: InexactError: Int64(12.99)
Stacktrace:
[1] Int64 at ./float.jl:710 [inlined]
[2] convert at ./number.jl:7 [inlined]
[3] setindex!(::Array{Int64,1}, ::Float64, ::Int64) at ./array.jl:847
[4] top-level scope at REPL[187]:1
whereas the following works
julia> y1 = [1.0:3.0;]
3-element Array{Float64,1}:
1.0
2.0
3.0
julia> y1[3] = y1[3] + 5.0
8.0
julia> y1[3] = y1[3] + 4.99
12.99
Though I feel kinda like this really shouldn’t be an error in Julia…