Skip to content

Commit b7b55cd

Browse files
committed
delete redundant methods of functions !=, >, >=
It is not intended for a package to ever add methods to the functions `>` or `>=`. The function `!=` should almost never get any new methods from packages, but I left in some methods where there might perhaps exist a performance reason to add it, just to be sure.
1 parent bdf1855 commit b7b55cd

File tree

1 file changed

+0
-78
lines changed

1 file changed

+0
-78
lines changed

src/type/compare.jl

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,9 @@ end
1414
@inline function (<)(x::DoubleFloat{T}, y::DoubleFloat{T}) where {T<:IEEEFloat}
1515
return (HI(x) < HI(y)) || (HI(x) === HI(y) && LO(x) < LO(y))
1616
end
17-
@inline function (>)(x::DoubleFloat{T}, y::DoubleFloat{T}) where {T<:IEEEFloat}
18-
return (HI(x) > HI(y)) || (HI(x) === HI(y) && LO(x) > LO(y))
19-
end
2017
@inline function (<=)(x::DoubleFloat{T}, y::DoubleFloat{T}) where {T<:IEEEFloat}
2118
return (HI(x) < HI(y)) || (HI(x) === HI(y) && LO(x) <= LO(y))
2219
end
23-
@inline function (>=)(x::DoubleFloat{T}, y::DoubleFloat{T}) where {T<:IEEEFloat}
24-
return (HI(x) > HI(y)) || (HI(x) === HI(y) && LO(x) >= LO(y))
25-
end
2620

2721
@inline function isequal(x::DoubleFloat{T}, y::DoubleFloat{T}) where {T<:IEEEFloat}
2822
return x == y || (isnan(x) && isnan(y))
@@ -38,37 +32,19 @@ end
3832
@inline function (==)(x::F, y::DoubleFloat{T}) where {T<:IEEEFloat, F<:AbstractFloat}
3933
return (==)(DoubleFloat{T}(x), y)
4034
end
41-
@inline function (!=)(x::DoubleFloat{T}, y::F) where {T<:IEEEFloat, F<:AbstractFloat}
42-
return (!=)(x, DoubleFloat{T}(y))
43-
end
44-
@inline function (!=)(x::F, y::DoubleFloat{T}) where {T<:IEEEFloat, F<:AbstractFloat}
45-
return (!=)(DoubleFloat{T}(x), y)
46-
end
4735

4836
@inline function (<)(x::DoubleFloat{T}, y::F) where {T<:IEEEFloat, F<:AbstractFloat}
4937
return (<)(x, DoubleFloat{T}(y))
5038
end
5139
@inline function (<)(x::F, y::DoubleFloat{T}) where {T<:IEEEFloat, F<:AbstractFloat}
5240
return (<)(DoubleFloat{T}(x), y)
5341
end
54-
@inline function (>)(x::DoubleFloat{T}, y::F) where {T<:IEEEFloat, F<:AbstractFloat}
55-
return (>)(x, DoubleFloat{T}(y))
56-
end
57-
@inline function (>)(x::F, y::DoubleFloat{T}) where {T<:IEEEFloat, F<:AbstractFloat}
58-
return (>)(DoubleFloat{T}(x), y)
59-
end
6042
@inline function (<=)(x::DoubleFloat{T}, y::F) where {T<:IEEEFloat, F<:AbstractFloat}
6143
return (<=)(x, DoubleFloat{T}(y))
6244
end
6345
@inline function (<=)(x::F, y::DoubleFloat{T}) where {T<:IEEEFloat, F<:AbstractFloat}
6446
return (<=)(DoubleFloat{T}(x), y)
6547
end
66-
@inline function (>=)(x::DoubleFloat{T}, y::F) where {T<:IEEEFloat, F<:AbstractFloat}
67-
return (>=)(x, DoubleFloat{T}(y))
68-
end
69-
@inline function (>=)(x::F, y::DoubleFloat{T}) where {T<:IEEEFloat, F<:AbstractFloat}
70-
return (>=)(DoubleFloat{T}(x), y)
71-
end
7248

7349
@inline function isequal(x::DoubleFloat{T}, y::F) where {T<:IEEEFloat, F<:AbstractFloat}
7450
return isequal(x, DoubleFloat{T}(y))
@@ -91,37 +67,19 @@ end
9167
@inline function (==)(x::Integer, y::DoubleFloat{T}) where {T<:IEEEFloat}
9268
return (==)(DoubleFloat{T}(x), y)
9369
end
94-
@inline function (!=)(x::DoubleFloat{T}, y::Integer) where {T<:IEEEFloat}
95-
return (!=)(x, DoubleFloat{T}(y))
96-
end
97-
@inline function (!=)(x::Integer, y::DoubleFloat{T}) where {T<:IEEEFloat}
98-
return (!=)(DoubleFloat{T}(x), y)
99-
end
10070

10171
@inline function (<)(x::DoubleFloat{T}, y::Integer) where {T<:IEEEFloat}
10272
return (<)(x, DoubleFloat{T}(y))
10373
end
10474
@inline function (<)(x::Integer, y::DoubleFloat{T}) where {T<:IEEEFloat}
10575
return (<)(DoubleFloat{T}(x), y)
10676
end
107-
@inline function (>)(x::DoubleFloat{T}, y::Integer) where {T<:IEEEFloat}
108-
return (>)(x, DoubleFloat{T}(y))
109-
end
110-
@inline function (>)(x::Integer, y::DoubleFloat{T}) where {T<:IEEEFloat}
111-
return (>)(DoubleFloat{T}(x), y)
112-
end
11377
@inline function (<=)(x::DoubleFloat{T}, y::Integer) where {T<:IEEEFloat}
11478
return (<=)(x, DoubleFloat{T}(y))
11579
end
11680
@inline function (<=)(x::Integer, y::DoubleFloat{T}) where {T<:IEEEFloat}
11781
return (<=)(DoubleFloat{T}(x), y)
11882
end
119-
@inline function (>=)(x::DoubleFloat{T}, y::Integer) where {T<:IEEEFloat}
120-
return (>=)(x, DoubleFloat{T}(y))
121-
end
122-
@inline function (>=)(x::Integer, y::DoubleFloat{T}) where {T<:IEEEFloat}
123-
return (>=)(DoubleFloat{T}(x), y)
124-
end
12583

12684
@inline function isequal(x::DoubleFloat{T}, y::Integer) where {T<:IEEEFloat}
12785
return isequal(x, DoubleFloat{T}(y))
@@ -152,15 +110,9 @@ end
152110
@inline function (<)(x::DoubleFloat{T}, y::Tuple{T,T}) where {T<:IEEEFloat}
153111
return (HI(x) < HI(y)) || (HI(x) === HI(y) && LO(x) < LO(y))
154112
end
155-
@inline function (>)(x::DoubleFloat{T}, y::Tuple{T,T}) where {T<:IEEEFloat}
156-
return (HI(x) > HI(y)) || (HI(x) === HI(y) && LO(x) > LO(y))
157-
end
158113
@inline function (<=)(x::DoubleFloat{T}, y::Tuple{T,T}) where {T<:IEEEFloat}
159114
return (HI(x) < HI(y)) || (HI(x) === HI(y) && LO(x) <= LO(y))
160115
end
161-
@inline function (>=)(x::DoubleFloat{T}, y::Tuple{T,T}) where {T<:IEEEFloat}
162-
return (HI(x) > HI(y)) || (HI(x) === HI(y) && LO(x) >= LO(y))
163-
end
164116

165117
@inline function isequal(x::DoubleFloat{T}, y::Tuple{T,T}) where {T<:IEEEFloat}
166118
return x == y
@@ -178,15 +130,9 @@ end
178130
@inline function (<)(x::Tuple{T,T}, y::DoubleFloat{T}) where {T<:IEEEFloat}
179131
return (HI(x) < HI(y)) || (HI(x) === HI(y) && LO(x) < LO(y))
180132
end
181-
@inline function (>)(x::Tuple{T,T}, y::DoubleFloat{T}) where {T<:IEEEFloat}
182-
return (HI(x) > HI(y)) || (HI(x) === HI(y) && LO(x) > LO(y))
183-
end
184133
@inline function (<=)(x::Tuple{T,T}, y::DoubleFloat{T}) where {T<:IEEEFloat}
185134
return (HI(x) < HI(y)) || (HI(x) === HI(y) && LO(x) <= LO(y))
186135
end
187-
@inline function (>=)(x::Tuple{T,T}, y::DoubleFloat{T}) where {T<:IEEEFloat}
188-
return (HI(x) > HI(y)) || (HI(x) === HI(y) && LO(x) >= LO(y))
189-
end
190136

191137
@inline function isequal(x::Tuple{T,T}, y::DoubleFloat{T}) where {T<:IEEEFloat}
192138
return x == y
@@ -200,26 +146,14 @@ end
200146
yy = DoubleFloat{T}(numerator(y)) / denominator(y)
201147
return x == yy
202148
end
203-
@inline function (!=)(x::DoubleFloat{T}, y::Rational) where {T<:IEEEFloat}
204-
yy = DoubleFloat{T}(numerator(y)) / denominator(y)
205-
return x != yy
206-
end
207149
@inline function (<)(x::DoubleFloat{T}, y::Rational) where {T<:IEEEFloat}
208150
yy = DoubleFloat{T}(numerator(y)) / denominator(y)
209151
return x < yy
210152
end
211-
@inline function (>)(x::DoubleFloat{T}, y::Rational) where {T<:IEEEFloat}
212-
yy = DoubleFloat{T}(numerator(y)) / denominator(y)
213-
return x > yy
214-
end
215153
@inline function (<=)(x::DoubleFloat{T}, y::Rational) where {T<:IEEEFloat}
216154
yy = DoubleFloat{T}(numerator(y)) / denominator(y)
217155
return x <= yy
218156
end
219-
@inline function (>=)(x::DoubleFloat{T}, y::Rational) where {T<:IEEEFloat}
220-
yy = DoubleFloat{T}(numerator(y)) / denominator(y)
221-
return x >= yy
222-
end
223157

224158
@inline function isequal(x::DoubleFloat{T}, y::Rational) where {T<:IEEEFloat}
225159
yy = DoubleFloat{T}(numerator(y)) / denominator(y)
@@ -236,26 +170,14 @@ end
236170
xx = DoubleFloat{T}(numerator(x)) / denominator(x)
237171
return xx == y
238172
end
239-
@inline function (!=)(x::Rational, y::DoubleFloat{T}) where {T<:IEEEFloat}
240-
xx = DoubleFloat{T}(numerator(x)) / denominator(x)
241-
return xx != y
242-
end
243173
@inline function (<)(x::Rational, y::DoubleFloat{T}) where {T<:IEEEFloat}
244174
xx = DoubleFloat{T}(numerator(x)) / denominator(x)
245175
return xx < y
246176
end
247-
@inline function (>)(x::Rational, y::DoubleFloat{T}) where {T<:IEEEFloat}
248-
xx = DoubleFloat{T}(numerator(x)) / denominator(x)
249-
return xx > y
250-
end
251177
@inline function (<=)(x::Rational, y::DoubleFloat{T}) where {T<:IEEEFloat}
252178
xx = DoubleFloat{T}(numerator(x)) / denominator(x)
253179
return xx <= y
254180
end
255-
@inline function (>=)(x::Rational, y::DoubleFloat{T}) where {T<:IEEEFloat}
256-
xx = DoubleFloat{T}(numerator(x)) / denominator(x)
257-
return xx >= y
258-
end
259181

260182
@inline function isequal(x::Rational, y::DoubleFloat{T}) where {T<:IEEEFloat}
261183
xx = DoubleFloat{T}(numerator(x)) / denominator(x)

0 commit comments

Comments
 (0)