JuliaDiff / DualNumbers.jl

Julia package for representing dual numbers and for performing dual algebra
Other
80 stars 30 forks source link

isapprox throws an error #51

Open dlfivefifty opened 7 years ago

dlfivefifty commented 7 years ago

I think real(::Type{Dual{T}}) needs to be overriden:

julia> dual(1.0,1.0) ≈ dual(1.0,1.0)
ERROR: MethodError: no method matching real(::Type{DualNumbers.Dual{Float64}})
Closest candidates are:
  real(::Complex{T<:Real}) at complex.jl:36
  real(::Real) at complex.jl:38
  real{T<:Real}(::Type{T<:Real}) at complex.jl:42
  ...
 in isapprox(::DualNumbers.Dual{Float64}, ::DualNumbers.Dual{Float64}) at ./floatfuncs.jl:251