For example, I have 4 numbers 1, 2, 3, 4.0
, and I want to get their promoted type. What should I do? I currently have two ways of writing
julia> promote_type(map(typeof, promote(1, 2, 3, 4.0))...)
Float64
or
julia> eltype(promote(1, 2, 3, 4.0))
Float64
Isn’t there a built-in way of doing this?