Skip to content

Commit 4a9c5fb

Browse files
committed
Clarify isgreater docstring
1 parent 09503cd commit 4a9c5fb

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

base/operators.jl

+6-9
Original file line numberDiff line numberDiff line change
@@ -174,17 +174,14 @@ isless(x::AbstractFloat, y::Real ) = (!isnan(x) & (isnan(y) | signless(x
174174
Test whether `x` is greater than `y`, according to a fixed total order.
175175
`isgreater` is defined in terms of `isless`, but is not the opposite of that function.
176176
177-
`isless` defines a fixed total order that ascends with unorderable values (such as `NaN`) and
178-
[`missing`](@ref) ordered last (biggest).
179-
`isgreater` defines a fixed total order that descends with unorderable values
180-
and `missing` ordered last (smallest).
181-
182-
Values that are normally unordered, such as `NaN`,
183-
are ordered after regular values.
184-
[`missing`](@ref) values are ordered last.
177+
`isless` defines a fixed total order that ascends, while `isgreater` defines a
178+
fixed total order that descends. Both order values that are normally unordered,
179+
such as `NaN`, after all regular values and [`missing`](@ref) last. So for
180+
`isless` these values are biggest and for `isgreater` these values are
181+
smallest.
185182
186183
# Implementation
187-
Types should usually not implement this function. Instead, implement `isless`.
184+
Types should not usually implement this function. Instead, implement `isless`.
188185
"""
189186
isgreater(a, b) = _is_unorderable(a) || _is_unorderable(b) ? isless(a, b) : isless(b, a)
190187
_is_unorderable(x) = !isa(x == x, Bool) || x != x

0 commit comments

Comments
 (0)