Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 0 additions & 58 deletions src/type/compare.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand All @@ -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)
Expand Down
Loading