Repository navigation
Define floatmin, floatmax, maxintfloat and issubnormal for Dual instances - #855
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #855 +/- ##
==========================================
- Coverage 91.06% 91.05% -0.02%
==========================================
Files 11 11
Lines 1086 1084 -2
==========================================
- Hits 989 987 -2
Misses 97 97 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…ual` instances (#852) `typemin`, `typemax`, `floatmin`, `floatmax` and `maxintfloat` now return the primal for both `Dual` instances and types instead of a `Dual` with zero partials, which only added overhead and could produce NaNs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b0d87da to
8c66edc
Compare
|
Thanks for this PR. It would fix a downstream break for us, and I'd like to ask whether it could be merged and released before Julia 1.14 is final. On Julia 1.14.0-alpha1, v1.4.8 came out without this change, so our |
Fixes #852.
Following JuliaLang/julia#63451,
typemin,typemax,floatmin,floatmaxandmaxintfloataccept instances as well as types. Base only forwards instances ofAbstractFloatto the type methods, sofloatmin(::Dual),floatmax(::Dual)andmaxintfloat(::Dual)threw aMethodError. So didmaxintfloat(::Type{<:Dual})andissubnormal(::Dual).These functions now return the primal, which is what
epsalready did, and they're defined together withepsin one loop. Before,typemin/typemax/floatmin/floatmaxreturned aDualwith zero partials, which only added overhead and could produce NaNs.🤖 Generated with Claude Code