JuliaDiff / JuliaDiff/DualNumbers.jl

isapprox throws an error

Open
#51 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
80
Forks
27
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue identifies Julia's isapprox path and the missing real(::Type{Dual{T}}) method. Start by tracing that call and the existing Dual type methods; done means dual(1.0, 1.0) ≈ dual(1.0, 1.0) no longer raises the shown MethodError.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.