hpoit
June 17, 2017, 11:04pm
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!
hpoit:
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
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
2 Likes
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…