-
Notifications
You must be signed in to change notification settings - Fork 156
Open
Description
Some operations generate Dual with NaN partials, and I'm not sure comparison operators are defined consistently for them...
julia> xs = Dual(0.0,NaN)
# it's not zero,
julia> iszero(xs)
false
# no, definitely not zero,
julia> xs ≈ 0
false
# it's a regular finite number:
julia> isnan(xs)
false
julia> isfinite(xs)
true
# moreover, it's a positive number
julia> xs > 0
true
# but adding this positive number, or multiplying it by anything still gives the same number back:
julia> xs + xs === xs
true
julia> xs * 1e100 === xs
true
# these are the defining properties of a zero
# shouldn't it be considered a zero really?Intuitively I would say that the most natural thing is to compare equal to zero, but maybe there are other self-consistent choices as well.
Metadata
Metadata
Assignees
Labels
No labels