Skip to content

Commit a89aa96

Browse files
committed
add rem2pi test
1 parent 4b54fd7 commit a89aa96

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/MiscTest.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ for i in 1:3, j in 1:3
136136
i != j && (@test h[i, j] 0.0)
137137
end
138138

139+
########
140+
# misc #
141+
########
142+
139143
# issue 267
140144
@noinline f267(z, x) = x[1]
141145
z267 = ([(1, (2), [(3, (4, 5, [1, 2, (3, (4, 5), [5])]), (5))])])
@@ -145,4 +149,8 @@ let z = z267
145149
@test ForwardDiff.hessian(h, [1.]) == zeros(1, 1)
146150
end
147151

148-
end
152+
# issue #290
153+
@test ForwardDiff.derivative(x -> rem2pi(x, RoundUp), rand()) == 1
154+
@test ForwardDiff.derivative(x -> rem2pi(x, RoundDown), rand()) == 1
155+
156+
end # module

0 commit comments

Comments
 (0)