From f6868d09308abba3b12593b840df7d263e57803f Mon Sep 17 00:00:00 2001 From: Neven Sajko Date: Sun, 20 Oct 2024 23:02:12 +0200 Subject: [PATCH] julia/Float: `x == 0` -> `iszero(x)` (#1870) Updates #1868 --- src/julia/Float.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/julia/Float.jl b/src/julia/Float.jl index f4ff55374..c39d6ffb3 100644 --- a/src/julia/Float.jl +++ b/src/julia/Float.jl @@ -91,7 +91,7 @@ divexact(a::Rational{T}, b::AbstractFloat; check::Bool=true) where T <: Union{Si divexact(a::Rational{BigInt}, b::BigFloat; check::Bool=true) = a/b function divides(a::BigFloat, b::BigFloat) - if b == 0 + if iszero(b) return false, BigFloat(0) else return true, divexact(a, b; check=false) @@ -109,7 +109,7 @@ end ############################################################################### function gcd(a::T, b::T) where T <: AbstractFloat - if a == 0 && b == 0 + if iszero(a) && iszero(b) return T(0) else return T(1) @@ -123,7 +123,7 @@ end ############################################################################### function ppio(a::T, b::T) where T <: AbstractFloat - if a == 0 && b == 0 + if iszero(a) && iszero(b) return T(0), T(0) else return T(1), a