Skip to content

Commit a7ef436

Browse files
authored
add tests
1 parent 36bf73c commit a7ef436

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

test/gamma_test.jl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
x = rand(10000)*170
2-
@test SpecialFunctions.gamma.(BigFloat.(x)) Bessels.gamma.(x)
3-
@test SpecialFunctions.gamma.(BigFloat.(-x)) Bessels.gamma.(-x)
4-
@test isnan(Bessels.gamma(NaN))
5-
@test isinf(Bessels.gamma(Inf))
1+
for (T, max) in ((Float16, 13), (Float32, 43), (Float64, 170))
2+
x = rand(T, 10000)*max
3+
@test SpecialFunctions.gamma.(widen.(x)) Bessels.gamma.(x)
4+
@test SpecialFunctions.gamma.(widen.(-x)) Bessels.gamma.(-x)
5+
@test isnan(Bessels.gamma(T(NaN)))
6+
@test isinf(Bessels.gamma(T(Inf)))
7+
end
68

79
x = [0, 1, 2, 3, 8, 15, 20, 30]
810
@test SpecialFunctions.gamma.(x) Bessels.gamma.(x)

0 commit comments

Comments
 (0)