Skip to content

Commit 925a365

Browse files
committed
Add isunorded docstring and compat admonitions
1 parent abf1be4 commit 925a365

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

base/operators.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,15 @@ largest values and `isgreater` defines a descending total order with `NaN` and
213213
This is unexported. Types should not usually implement this function. Instead, implement `isless`.
214214
"""
215215
isgreater(x, y) = isunordered(x) || isunordered(y) ? isless(x, y) : isless(y, x)
216+
217+
"""
218+
isunordered(x)
219+
220+
Return true if `x` is a value that is not normally orderable, such as `NaN` or `missing`.
221+
222+
!!! compat "Julia 1.7"
223+
This method requires Julia 1.7 or later.
224+
"""
216225
isunordered(x) = false
217226
isunordered(x::AbstractFloat) = isnan(x)
218227
isunordered(x::Missing) = true

base/reduce.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,9 @@ are multiple maximal points, then the first one will be returned.
775775
776776
Values are compared with `isless`.
777777
778+
!!! compat "Julia 1.7"
779+
This method requires Julia 1.7 or later.
780+
778781
# Examples
779782
780783
```jldoctest
@@ -828,6 +831,9 @@ are multiple minimal points, then the first one will be returned.
828831
829832
`NaN` is treated as less than all other values except `missing`.
830833
834+
!!! compat "Julia 1.7"
835+
This method requires Julia 1.7 or later.
836+
831837
# Examples
832838
833839
```jldoctest
@@ -881,6 +887,9 @@ If there are multiple maximal values for `f(x)` then the first one will be found
881887
882888
Values are compared with `isless`.
883889
890+
!!! compat "Julia 1.7"
891+
This method requires Julia 1.7 or later.
892+
884893
# Examples
885894
```jldoctest
886895
julia> argmax(abs, -10:5)
@@ -926,6 +935,9 @@ If there are multiple minimal values for `f(x)` then the first one will be found
926935
927936
`NaN` is treated as less than all other values except `missing`.
928937
938+
!!! compat "Julia 1.7"
939+
This method requires Julia 1.7 or later.
940+
929941
# Examples
930942
```jldoctest
931943
julia> argmin(sign, -10:5)

0 commit comments

Comments
 (0)