Julia Arrays
Julia supports single- and multi-dimensional arrays.
Contents
Declaration
julia> [1,2,3]
3-element Vector{Int64}:
1
2
3Arrays take the common type of all their elements. If the elements are not of the same type but have a common promotion type, the elements are recast.
julia> [1, 2.3, 4//5]
3-element Vector{Float64}:
1.0
2.3
0.8Elements can also be explicitly recast at declaration of an array.
julia> Float32[1, 2.3, 4//5]
3-element Vector{Float32}:
1.0
2.3
0.8