Skip to content

Commit fc03fa4

Browse files
committed
rename is_poisoning -> isunordered and export
1 parent 07b6cac commit fc03fa4

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

base/exports.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,7 @@ export
656656
isequal,
657657
ismutable,
658658
isless,
659+
isunordered,
659660
ifelse,
660661
objectid,
661662
sizeof,

base/operators.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,10 @@ largest values and `isgreater` defines a descending total order with `NaN` and
212212
# Implementation
213213
This is unexported. Types should not usually implement this function. Instead, implement `isless`.
214214
"""
215-
isgreater(x, y) = is_poisoning(x) || is_poisoning(y) ? isless(x, y) : isless(y, x)
216-
is_poisoning(x) = false
217-
is_poisoning(x::AbstractFloat) = isnan(x)
218-
is_poisoning(x::Missing) = true
215+
isgreater(x, y) = isunordered(x) || isunordered(y) ? isless(x, y) : isless(y, x)
216+
isunordered(x) = false
217+
isunordered(x::AbstractFloat) = isnan(x)
218+
isunordered(x::Missing) = true
219219

220220
function ==(T::Type, S::Type)
221221
@_pure_meta

base/reducedim.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ for (f1, f2, typeextreme) in ((:min, :max, :typemax), (:max, :min, :typemin))
148148
Tr = v0 isa T ? T : typeof(v0)
149149

150150
# but NaNs and missing need to be avoided as initial values
151-
if is_poisoning(v0)
151+
if isunordered(v0)
152152
Tnm = nonmissingtype(Tr)
153153
# TODO: Some types, like BigInt, don't support typemin/typemax.
154154
# So a Matrix{Union{BigInt, Missing}} can still error here.

0 commit comments

Comments
 (0)