JuliaLang / julia

The Julia Programming Language
https://julialang.org/
MIT License
45.89k stars 5.49k forks source link

Some Base.math functions don't have methods for Missing #32655

Open ElOceanografo opened 5 years ago

ElOceanografo commented 5 years ago

I noticed this trying to convert a missing angle using deg2rad,

julia> deg2rad(missing)
ERROR: MethodError: no method matching deg2rad(::Missing)
Closest candidates are:
  deg2rad(::AbstractFloat) at math.jl:178
...

but it turns out there are a number of other Base.math functions with no method defined for Missings (e.g. asec, acoth, hypot...) . The loop here only defines Missing methods for a subset of the module's exported functions. Fix should be as easy as adding those names to the loop (unless there's some good reason to keep those methods undefined).

ElOceanografo commented 5 years ago

Realized this is a partial duplicate of https://github.com/JuliaLang/julia/issues/32224. This PR will add missing methods for atan, hypot, and angle, but not all the similar functions exported by Base.math.