Skip to content

Commit

Permalink
Backport #605 (dual exponent) to release-0.10 (#614)
Browse files Browse the repository at this point in the history
* dual exponent (#605)

* add exponent(::Dual)

* revert spacing

* tell CI to run on this branch

* version bump

Co-authored-by: Paul Tiede <ptiede91@gmail.com>
  • Loading branch information
mcabbott and ptiede authored Dec 10, 2022
1 parent 61e4dd4 commit eb8d755
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ on:
pull_request:
branches:
- master
- release-0.10
push:
branches:
- master
- release-0.10
tags: '*'
jobs:
test:
Expand All @@ -17,6 +19,7 @@ jobs:
matrix:
version:
- '1.0'
- '1.6'
- '1'
- 'nightly'
os:
Expand Down
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.32"
version = "0.10.34"

[deps]
CommonSubexpressions = "bbf7d656-a473-5ed7-a52c-81e309532950"
Expand Down
2 changes: 2 additions & 0 deletions src/dual.jl
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ Base.fld(x::Dual, y::Dual) = fld(value(x), value(y))

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

Base.exponent(x::Dual) = exponent(value(x))

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

@test exponent(FDNUM) === exponent(PRIMAL)
@test exponent(FDNUM2) === exponent(PRIMAL2)
@test exponent(NESTED_FDNUM) === exponent(PRIMAL)

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

2 comments on commit eb8d755

@mcabbott
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/73859

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.10.34 -m "<description of version>" eb8d755bc7752b4fe2a50bca5ffae336ef288c12
git push origin v0.10.34

Please sign in to comment.