Skip to content

Commit 1b93064

Browse files
authored
improve tests
1 parent 1822b27 commit 1b93064

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/gamma_test.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
for (T, max) in ((Float16, 13), (Float32, 43), (Float64, 170))
22
v = rand(T, 10000)*max
33
for x in v
4-
@test T(SpecialFunctions.gamma(widen(x))) Bessels.gamma(x)
4+
@test isapprox(T(SpecialFunctions.gamma(widen(x))), Bessels.gamma(x)
55
if isinteger(x)
66
@test_throws DomainError Bessels.gamma(-x)
77
else
8-
@test isapprox(T(SpecialFunctions.gamma(widen(-x))), Bessels.gamma(-x), atol=nextfloat(Float16(0.),2))
8+
@test isapprox(T(SpecialFunctions.gamma(widen(-x))), Bessels.gamma(-x), atol=nextfloat(T(0.),2), rtol=1.5*eps(T))
99
end
1010
end
1111
@test isnan(Bessels.gamma(T(NaN)))

0 commit comments

Comments
 (0)