From 840a83e0d8f28ab60098ca3547f82048ffff3533 Mon Sep 17 00:00:00 2001 From: Neven Sajko Date: Mon, 8 Sep 2025 01:45:15 +0200 Subject: [PATCH] delete redundant methods of functions `>`, `>=` It is not intended for a package to ever add methods to the functions `>` or `>=`. --- src/type/compare.jl | 58 --------------------------------------------- 1 file changed, 58 deletions(-) diff --git a/src/type/compare.jl b/src/type/compare.jl index 9bafdead..a34a0bf7 100644 --- a/src/type/compare.jl +++ b/src/type/compare.jl @@ -14,15 +14,9 @@ end @inline function (<)(x::DoubleFloat{T}, y::DoubleFloat{T}) where {T<:IEEEFloat} return (HI(x) < HI(y)) || (HI(x) === HI(y) && LO(x) < LO(y)) end -@inline function (>)(x::DoubleFloat{T}, y::DoubleFloat{T}) where {T<:IEEEFloat} - return (HI(x) > HI(y)) || (HI(x) === HI(y) && LO(x) > LO(y)) -end @inline function (<=)(x::DoubleFloat{T}, y::DoubleFloat{T}) where {T<:IEEEFloat} return (HI(x) < HI(y)) || (HI(x) === HI(y) && LO(x) <= LO(y)) end -@inline function (>=)(x::DoubleFloat{T}, y::DoubleFloat{T}) where {T<:IEEEFloat} - return (HI(x) > HI(y)) || (HI(x) === HI(y) && LO(x) >= LO(y)) -end @inline function isequal(x::DoubleFloat{T}, y::DoubleFloat{T}) where {T<:IEEEFloat} return x == y || (isnan(x) && isnan(y)) @@ -51,24 +45,12 @@ end @inline function (<)(x::F, y::DoubleFloat{T}) where {T<:IEEEFloat, F<:AbstractFloat} return (<)(DoubleFloat{T}(x), y) end -@inline function (>)(x::DoubleFloat{T}, y::F) where {T<:IEEEFloat, F<:AbstractFloat} - return (>)(x, DoubleFloat{T}(y)) -end -@inline function (>)(x::F, y::DoubleFloat{T}) where {T<:IEEEFloat, F<:AbstractFloat} - return (>)(DoubleFloat{T}(x), y) -end @inline function (<=)(x::DoubleFloat{T}, y::F) where {T<:IEEEFloat, F<:AbstractFloat} return (<=)(x, DoubleFloat{T}(y)) end @inline function (<=)(x::F, y::DoubleFloat{T}) where {T<:IEEEFloat, F<:AbstractFloat} return (<=)(DoubleFloat{T}(x), y) end -@inline function (>=)(x::DoubleFloat{T}, y::F) where {T<:IEEEFloat, F<:AbstractFloat} - return (>=)(x, DoubleFloat{T}(y)) -end -@inline function (>=)(x::F, y::DoubleFloat{T}) where {T<:IEEEFloat, F<:AbstractFloat} - return (>=)(DoubleFloat{T}(x), y) -end @inline function isequal(x::DoubleFloat{T}, y::F) where {T<:IEEEFloat, F<:AbstractFloat} return isequal(x, DoubleFloat{T}(y)) @@ -104,24 +86,12 @@ end @inline function (<)(x::Integer, y::DoubleFloat{T}) where {T<:IEEEFloat} return (<)(DoubleFloat{T}(x), y) end -@inline function (>)(x::DoubleFloat{T}, y::Integer) where {T<:IEEEFloat} - return (>)(x, DoubleFloat{T}(y)) -end -@inline function (>)(x::Integer, y::DoubleFloat{T}) where {T<:IEEEFloat} - return (>)(DoubleFloat{T}(x), y) -end @inline function (<=)(x::DoubleFloat{T}, y::Integer) where {T<:IEEEFloat} return (<=)(x, DoubleFloat{T}(y)) end @inline function (<=)(x::Integer, y::DoubleFloat{T}) where {T<:IEEEFloat} return (<=)(DoubleFloat{T}(x), y) end -@inline function (>=)(x::DoubleFloat{T}, y::Integer) where {T<:IEEEFloat} - return (>=)(x, DoubleFloat{T}(y)) -end -@inline function (>=)(x::Integer, y::DoubleFloat{T}) where {T<:IEEEFloat} - return (>=)(DoubleFloat{T}(x), y) -end @inline function isequal(x::DoubleFloat{T}, y::Integer) where {T<:IEEEFloat} return isequal(x, DoubleFloat{T}(y)) @@ -152,15 +122,9 @@ end @inline function (<)(x::DoubleFloat{T}, y::Tuple{T,T}) where {T<:IEEEFloat} return (HI(x) < HI(y)) || (HI(x) === HI(y) && LO(x) < LO(y)) end -@inline function (>)(x::DoubleFloat{T}, y::Tuple{T,T}) where {T<:IEEEFloat} - return (HI(x) > HI(y)) || (HI(x) === HI(y) && LO(x) > LO(y)) -end @inline function (<=)(x::DoubleFloat{T}, y::Tuple{T,T}) where {T<:IEEEFloat} return (HI(x) < HI(y)) || (HI(x) === HI(y) && LO(x) <= LO(y)) end -@inline function (>=)(x::DoubleFloat{T}, y::Tuple{T,T}) where {T<:IEEEFloat} - return (HI(x) > HI(y)) || (HI(x) === HI(y) && LO(x) >= LO(y)) -end @inline function isequal(x::DoubleFloat{T}, y::Tuple{T,T}) where {T<:IEEEFloat} return x == y @@ -178,15 +142,9 @@ end @inline function (<)(x::Tuple{T,T}, y::DoubleFloat{T}) where {T<:IEEEFloat} return (HI(x) < HI(y)) || (HI(x) === HI(y) && LO(x) < LO(y)) end -@inline function (>)(x::Tuple{T,T}, y::DoubleFloat{T}) where {T<:IEEEFloat} - return (HI(x) > HI(y)) || (HI(x) === HI(y) && LO(x) > LO(y)) -end @inline function (<=)(x::Tuple{T,T}, y::DoubleFloat{T}) where {T<:IEEEFloat} return (HI(x) < HI(y)) || (HI(x) === HI(y) && LO(x) <= LO(y)) end -@inline function (>=)(x::Tuple{T,T}, y::DoubleFloat{T}) where {T<:IEEEFloat} - return (HI(x) > HI(y)) || (HI(x) === HI(y) && LO(x) >= LO(y)) -end @inline function isequal(x::Tuple{T,T}, y::DoubleFloat{T}) where {T<:IEEEFloat} return x == y @@ -208,18 +166,10 @@ end yy = DoubleFloat{T}(numerator(y)) / denominator(y) return x < yy end -@inline function (>)(x::DoubleFloat{T}, y::Rational) where {T<:IEEEFloat} - yy = DoubleFloat{T}(numerator(y)) / denominator(y) - return x > yy -end @inline function (<=)(x::DoubleFloat{T}, y::Rational) where {T<:IEEEFloat} yy = DoubleFloat{T}(numerator(y)) / denominator(y) return x <= yy end -@inline function (>=)(x::DoubleFloat{T}, y::Rational) where {T<:IEEEFloat} - yy = DoubleFloat{T}(numerator(y)) / denominator(y) - return x >= yy -end @inline function isequal(x::DoubleFloat{T}, y::Rational) where {T<:IEEEFloat} yy = DoubleFloat{T}(numerator(y)) / denominator(y) @@ -244,18 +194,10 @@ end xx = DoubleFloat{T}(numerator(x)) / denominator(x) return xx < y end -@inline function (>)(x::Rational, y::DoubleFloat{T}) where {T<:IEEEFloat} - xx = DoubleFloat{T}(numerator(x)) / denominator(x) - return xx > y -end @inline function (<=)(x::Rational, y::DoubleFloat{T}) where {T<:IEEEFloat} xx = DoubleFloat{T}(numerator(x)) / denominator(x) return xx <= y end -@inline function (>=)(x::Rational, y::DoubleFloat{T}) where {T<:IEEEFloat} - xx = DoubleFloat{T}(numerator(x)) / denominator(x) - return xx >= y -end @inline function isequal(x::Rational, y::DoubleFloat{T}) where {T<:IEEEFloat} xx = DoubleFloat{T}(numerator(x)) / denominator(x)