Skip to content

Commit

Permalink
Update src/auxiliary/math.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielDoehring authored Dec 18, 2023
1 parent 72fdb4a commit ea9d394
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/auxiliary/math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
# AbstractFloat clashes with ForwardDiff.Dual
sqrt_(x::T) where {T <: Real} = x < zero(x) ? oftype(x, NaN) : Base.sqrt(x)
# < 0 suffices since log(0) = -Inf
log_(x::T) where {T <: AbstractFloat} = x < zero(x) ? oftype(x, NaN) : Base.log(x)
# `AbstractFloat` clashes with `ForwardDiff.Dual` => use `Real`
log_(x::T) where {T <: Real} = x < zero(x) ? oftype(x, NaN) : Base.log(x)

"""
ln_mean(x, y)
Expand Down

0 comments on commit ea9d394

Please sign in to comment.