For example, if I have a function
function f(x::Int)
if x == 0
throw(DivideError())
return 2.0 / x
end
What return type should I specify at the end of f(x::Int)
? Should I consider Union{DivideError, Float64}
or just Float64
?
I know there is a package ResultTypes.jl that can handle this. But is it necessary to use it?