Skip to content

Commit c6e3777

Browse files
authored
Merge pull request #118 from JuliaMath/os/besselh-default-k
default besselh to k=1 like the docs say it does
2 parents ec6c51d + f1427e9 commit c6e3777

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/BesselFunctions/hankel.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ function besselh(nu::Real, k::Integer, x)
217217
end
218218
end
219219

220+
besselh(nu, x) = besselh(nu, 1, x)
221+
220222
function besselh(nu::AbstractRange, k::Integer, x::T) where T
221223
(nu[1] >= 0 && step(nu) == 1) || throw(ArgumentError("nu must be >= 0 with step(nu)=1"))
222224
if nu[end] < x

test/hankel_test.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,7 @@ v, x = 14.3, 29.4
3131
@test isapprox(hankelh1(0.5:1:25.5, 15.0), SpecialFunctions.hankelh1.(0.5:1:25.5, 15.0), rtol=2e-13)
3232
@test isapprox(hankelh1(1:50, 100.0), SpecialFunctions.hankelh1.(1:50, 100.0), rtol=2e-13)
3333
@test isapprox(hankelh2(1:50, 10.0), SpecialFunctions.hankelh2.(1:50, 10.0), rtol=2e-13)
34+
35+
#test 2 arg version
36+
@test besselh(v, 1, x) == besselh(v, x)
37+
@test besselh(1:50, 1, 10.0) == besselh(1:50, 10.0)

0 commit comments

Comments
 (0)