What are the DataType and Union definitions?


#1
typeof(Union{Real,Rational}) # => DataType
typeof(Union{Real,String}) # => Union (1)
typeof(Union{Real,Float64}) # => DataType
typeof(Union{Int64,Float64}) # => Union (2)
typeof(Union{Real,Float64,Rational}) # => DataType
typeof(Union{Real,AbstractFloat,Rational}) # => DataType

DataType and Union definitions are not clear to me. Help is appreciated!


#2
julia> Union{Real,Rational}
Real

julia> Union{Real,String}
Union{Real, String}

julia> Union{Real,Float64}
Real

julia> Union{Int64,Float64}
Union{Float64, Int64}

julia> Union{Real,Float64,Rational}
Real

julia> Union{Real,AbstractFloat,Rational}
Real

#3

I’ll add that if the code shown above doesn’t answer your question, you need to be more specific about what your confusion is…