Skip to content

Commit 5e1da6f

Browse files
committed
add NaN check
1 parent 283ee5e commit 5e1da6f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/AiryFunctions/cairy.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ airyai(z::Number) = _airyai(float(z))
5050
airyaix(z::Number) = _airyaix(float(z))
5151

5252
function _airyai(z::Complex{T}) where T <: Union{Float32, Float64}
53+
isnan(z) && return z
5354
x, y = reim(z)
5455

5556
check_conj = false
@@ -74,6 +75,7 @@ function _airyai(z::Complex{T}) where T <: Union{Float32, Float64}
7475
end
7576

7677
function _airyaix(z::Complex{T}) where T <: Union{Float32, Float64}
78+
isnan(z) && return z
7779
x, y = real(z), imag(z)
7880

7981
check_conj = false
@@ -120,6 +122,7 @@ airyaiprime(z::Number) = _airyaiprime(float(z))
120122
airyaiprimex(z::Number) = _airyaiprimex(float(z))
121123

122124
function _airyaiprime(z::Complex{T}) where T <: Union{Float32, Float64}
125+
isnan(z) && return z
123126
x, y = reim(z)
124127

125128
check_conj = false
@@ -143,6 +146,7 @@ function _airyaiprime(z::Complex{T}) where T <: Union{Float32, Float64}
143146
end
144147

145148
function _airyaiprimex(z::Complex{T}) where T <: Union{Float32, Float64}
149+
isnan(z) && return z
146150
x, y = reim(z)
147151

148152
check_conj = false
@@ -188,6 +192,7 @@ See also: [`airybiprime`](@ref), [`airyai`](@ref)
188192
airybi(z::Number) = _airybi(float(z))
189193

190194
function _airybi(z::Complex{T}) where T <: Union{Float32, Float64}
195+
isnan(z) && return z
191196
x, y = real(z), imag(z)
192197

193198
check_conj = false
@@ -232,6 +237,7 @@ See also: [`airybi`](@ref), [`airyai`](@ref)
232237
airybiprime(z::Number) = _airybiprime(float(z))
233238

234239
function _airybiprime(z::Complex{T}) where T <: Union{Float32, Float64}
240+
isnan(z) && return z
235241
x, y = real(z), imag(z)
236242

237243
check_conj = false

0 commit comments

Comments
 (0)