From 957a202ad995dcf37bf42dda6afe2a3f469fa829 Mon Sep 17 00:00:00 2001 From: Neven Sajko Date: Fri, 18 Oct 2024 13:12:49 +0200 Subject: [PATCH] julia/Float: `x == 0` -> `iszero(x)` 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 f4ff553743..c39d6ffb30 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