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 9931e04 commit 72fdb4a
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 @@ -5,7 +5,8 @@
@muladd begin
#! format: noindent

sqrt_(x::T) where {T <: AbstractFloat} = x < zero(x) ? oftype(x, NaN) : Base.sqrt(x)
# 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)

Expand Down

0 comments on commit 72fdb4a

Please sign in to comment.