Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ForwardDiff"
uuid = "f6369f11-7733-5829-9624-2563aa707210"
version = "0.10.25"
version = "0.10.26"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe @KristofferC prefers to let a few changes to build up before cutting a release?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's already an open PR for making a new release (with the NaNMath compat PR) which nobody has reviewed for weeks...


[deps]
CommonSubexpressions = "bbf7d656-a473-5ed7-a52c-81e309532950"
Expand Down
4 changes: 4 additions & 0 deletions src/dual.jl
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@ Base.trunc(d::Dual) = trunc(value(d))
Base.round(::Type{R}, d::Dual) where {R<:Real} = round(R, value(d))
Base.round(d::Dual) = round(value(d))

Base.fld(x::Dual, y::Dual) = fld(value(x), value(y))

Base.cld(x::Dual, y::Dual) = cld(value(x), value(y))

if VERSION ≥ v"1.4"
Base.div(x::Dual, y::Dual, r::RoundingMode) = div(value(x), value(y), r)
else
Expand Down
8 changes: 8 additions & 0 deletions test/DualTest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ for N in (0,3), M in (0,4), V in (Int, Float32)
@test round(FDNUM2) === round(PRIMAL2)
@test round(NESTED_FDNUM) === round(PRIMAL)

@test fld(FDNUM, FDNUM2) === fld(PRIMAL, PRIMAL2)
@test fld(FDNUM, PRIMAL2) === fld(PRIMAL, PRIMAL2)
@test fld(PRIMAL, FDNUM2) === fld(PRIMAL, PRIMAL2)

@test cld(FDNUM, FDNUM2) === cld(PRIMAL, PRIMAL2)
@test cld(FDNUM, PRIMAL2) === cld(PRIMAL, PRIMAL2)
@test cld(PRIMAL, FDNUM2) === cld(PRIMAL, PRIMAL2)

@test div(FDNUM, FDNUM2) === div(PRIMAL, PRIMAL2)
@test div(FDNUM, PRIMAL2) === div(PRIMAL, PRIMAL2)
@test div(PRIMAL, FDNUM2) === div(PRIMAL, PRIMAL2)
Expand Down