Skip to content

Commit

Permalink
add rem2pi test
Browse files Browse the repository at this point in the history
  • Loading branch information
jrevels committed Jan 10, 2018
1 parent eb06c54 commit 1bb514e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/MiscTest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ for i in 1:3, j in 1:3
i != j && (@test h[i, j] 0.0)
end

########
# misc #
########

# issue 267
@noinline f267(z, x) = x[1]
z267 = ([(1, (2), [(3, (4, 5, [1, 2, (3, (4, 5), [5])]), (5))])])
Expand All @@ -145,4 +149,8 @@ let z = z267
@test ForwardDiff.hessian(h, [1.]) == zeros(1, 1)
end

end
# issue #290
@test ForwardDiff.derivative(x -> rem2pi(x, RoundUp), rand()) == 1
@test ForwardDiff.derivative(x -> rem2pi(x, RoundDown), rand()) == 1

end # module

0 comments on commit 1bb514e

Please sign in to comment.