Skip to content

Commit ce95997

Browse files
JamesWrigleyKristofferC
authored andcommitted
Type-assert isfinite(::AbstractFloat) (#59888)
(cherry picked from commit 78ba3be)
1 parent e588298 commit ce95997

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

base/float.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ See also: [`iszero`](@ref), [`isone`](@ref), [`isinf`](@ref), [`ismissing`](@ref
709709
isnan(x::AbstractFloat) = (x != x)::Bool
710710
isnan(x::Number) = false
711711

712-
isfinite(x::AbstractFloat) = !isnan(x - x)
712+
isfinite(x::AbstractFloat) = !(isnan(x - x)::Bool)
713713
isfinite(x::Real) = decompose(x)[3] != 0
714714
isfinite(x::Integer) = true
715715

0 commit comments

Comments
 (0)