JuliaDiff / JuliaDiff/ForwardDiff.jl
Rationals and Modulo
Open
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 1k
- Forks
- 160
- PR merge metrics
- No merged PRs in 30d
Description
Differentiation with modulo function yields a Float, even for Rational input.
What doesn't work:
ForwardDiff.derivative(x->mod(x^2,1), 1//3)
0.6666666666666666
What works:
ForwardDiff.derivative(x->x^2, 1//3)
2//3
mod(1//2,1)
1//2
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the ForwardDiff.derivative example with a Rational input and compare it with the working derivative and mod examples. Investigate the ForwardDiff.derivative and mod entry points to determine where the result becomes a Float; done means the derivative for this case retains the Rational result shown by the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100