@@ -35,19 +35,22 @@ Base.isone(q::AbstractQuaternion{T}) where {T<:Number} = isone(q[1]) && iszero(q
3535"""
3636 iszerovalue(x)
3737
38- !!! warn "Private function!"
38+ !!! warning "Private function!"
3939
40- This function is considered private and may change or be removed without warning.
40+ This function is private and may change or be removed without warning.
4141
4242This is essentially `Base.iszero`, but intended to be overridden for types like
4343`ForwardDiff.Dual`, where the value may be zero, but if the tangent is not zero, then
44- `Base.iszero` will return `false`.
44+ `Base.iszero` will return `false`. This function, on the other hand, ignores the tangent
45+ part, and will return `true` if and only if the value part is zero.
4546
4647This is needed internally in math functions like `exp`, `log`, and `sqrt`, where we
4748frequently need to switch the algorithm based on whether some components are zero. In those
4849isolated cases, a Taylor series should be provided that will be exactly zero for, e.g.,
4950`Float64`, but will also work correctly for `ForwardDiff.Dual` and other ADs.
5051
52+ Like `Base.iszero`, this function is defined recursively for arrays and quaternions.
53+
5154"""
5255iszerovalue (x) = iszero (x)
5356iszerovalue (x:: AbstractArray ) = all (iszerovalue, x)
0 commit comments