Skip to content

Commit 4f41688

Browse files
committed
return x ~isfinite
1 parent a3c767f commit 4f41688

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/besseli.jl

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,7 @@ _besseli(nu, x::Float16) = Float16(_besseli(nu, Float32(x)))
170170

171171
function _besseli(nu, x::T) where T <: Union{Float32, Float64}
172172
isinteger(nu) && return _besseli(Int(nu), x)
173-
if ~isfinite(x)
174-
isnan(x) && return x
175-
isinf(x) && return x
176-
end
173+
~isfinite(x) && return x
177174
abs_nu = abs(nu)
178175
abs_x = abs(x)
179176

@@ -196,10 +193,7 @@ function _besseli(nu, x::T) where T <: Union{Float32, Float64}
196193
end
197194
end
198195
function _besseli(nu::Integer, x::T) where T <: Union{Float32, Float64}
199-
if ~isfinite(x)
200-
isnan(x) && return x
201-
isinf(x) && return x
202-
end
196+
~isfinite(x) && return x
203197
abs_nu = abs(nu)
204198
abs_x = abs(x)
205199
sg = iseven(abs_nu) ? 1 : -1

0 commit comments

Comments
 (0)