NaNMath.jl icon indicating copy to clipboard operation
NaNMath.jl copied to clipboard

NaNMath functions should fallback to the default method

Open YingboMa opened this issue 1 year ago • 1 comments

julia> asin(1+1im)
0.6662394324925153 + 1.0612750619050357im

julia> using NaNMath

julia> NaNMath.asin(1+1im)
ERROR: MethodError: no method matching asin(::Complex{Int64})
You may have intended to import Base.asin

Closest candidates are:
  asin(::DualNumbers.Dual)
   @ DualNumbers ~/.julia/packages/DualNumbers/5knFX/src/dual.jl:327
  asin(::PolyForm{<:Number})
   @ SymbolicUtils ~/src/julia/SymbolicUtils/src/methods.jl:87
  asin(::SymbolicUtils.BasicSymbolic{<:Number})
   @ SymbolicUtils ~/src/julia/SymbolicUtils/src/methods.jl:87
  ...

Stacktrace:
 [1] top-level scope
   @ REPL[7]:1

YingboMa avatar Aug 01 '23 00:08 YingboMa

IntervalArithmetic would benefit from this too. I was just about to submit a pull request for a NaNMath extension in IntervalArithmetic, then realised it would be more effective if NaNMath fellback to Base functions for other numeric types inputted. Is there any work on this? I'm happy to pick this up.

kapple19 avatar Aug 21 '24 11:08 kapple19