Skip to content

Commit eb8d755

Browse files
mcabbottptiede
andauthored
Backport #605 (dual exponent) to release-0.10 (#614)
* 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>
1 parent 61e4dd4 commit eb8d755

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ on:
33
pull_request:
44
branches:
55
- master
6+
- release-0.10
67
push:
78
branches:
89
- master
10+
- release-0.10
911
tags: '*'
1012
jobs:
1113
test:
@@ -17,6 +19,7 @@ jobs:
1719
matrix:
1820
version:
1921
- '1.0'
22+
- '1.6'
2023
- '1'
2124
- 'nightly'
2225
os:

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ForwardDiff"
22
uuid = "f6369f11-7733-5829-9624-2563aa707210"
3-
version = "0.10.32"
3+
version = "0.10.34"
44

55
[deps]
66
CommonSubexpressions = "bbf7d656-a473-5ed7-a52c-81e309532950"

src/dual.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,8 @@ Base.fld(x::Dual, y::Dual) = fld(value(x), value(y))
332332

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

335+
Base.exponent(x::Dual) = exponent(value(x))
336+
335337
if VERSION v"1.4"
336338
Base.div(x::Dual, y::Dual, r::RoundingMode) = div(value(x), value(y), r)
337339
else

test/DualTest.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ for N in (0,3), M in (0,4), V in (Int, Float32)
155155
@test fld(FDNUM, PRIMAL2) === fld(PRIMAL, PRIMAL2)
156156
@test fld(PRIMAL, FDNUM2) === fld(PRIMAL, PRIMAL2)
157157

158+
@test exponent(FDNUM) === exponent(PRIMAL)
159+
@test exponent(FDNUM2) === exponent(PRIMAL2)
160+
@test exponent(NESTED_FDNUM) === exponent(PRIMAL)
161+
158162
@test cld(FDNUM, FDNUM2) === cld(PRIMAL, PRIMAL2)
159163
@test cld(FDNUM, PRIMAL2) === cld(PRIMAL, PRIMAL2)
160164
@test cld(PRIMAL, FDNUM2) === cld(PRIMAL, PRIMAL2)

0 commit comments

Comments
 (0)