P3109 comparisons and extrema #
Comparisons are unordered at NaN. compare is the order behind == on P3109 values, so NaN
compares unequal to itself. The ten extrema differ in NaN handling, magnitude ordering, and
preference for finite operands. Equal magnitudes use numerical order to resolve the sign, so
minimum selects the negative operand and maximum the positive one.
Reference: P3109 unapproved interim report 4.0.3, revision 34f5964, §§4.11–4.12.
Strict extended-real comparison, with NaN unordered even against itself.
Instances For
Numerical equality, ignoring NaN payloads by making every NaN comparison false.
Instances For
Non-strict extended-real comparison, with NaN unordered.
Instances For
Reverse strict comparison.
Instances For
Reverse non-strict comparison.
Instances For
Minimum, propagating either NaN operand.
Instances For
Maximum, propagating either NaN operand.
Instances For
Ignore a single NaN before applying an extremum. Two NaNs give the canonical NaN.
Instances For
Minimum with a numerical operand preferred to NaN.
Instances For
Maximum with a numerical operand preferred to NaN.
Instances For
Minimum absolute value, resolving equal magnitudes toward the numerically smaller datum.
Instances For
Maximum absolute value, resolving equal magnitudes toward the numerically larger datum.
Instances For
Minimum magnitude with a numerical operand preferred to NaN.
Instances For
Maximum magnitude with a numerical operand preferred to NaN.
Instances For
Prefer the finite operand to an infinity, then use the supplied number extremum.
Instances For
Minimum finite variant: finite values outrank infinities, which outrank NaN.
Instances For
Maximum finite variant: finite values outrank infinities, which outrank NaN.
Instances For
Report §4.11.4 clamp, propagating NaN and rejecting reversed bounds.
Instances For
Clamp value to [lower, upper] with exact bound checks, then project once into target, by
default the format of value. Reversed bounds and NaN yield NaN.
Instances For
Strict comparison of decoded operands, with NaN unordered.
Instances For
Non-strict comparison of decoded operands, with NaN unordered.
Instances For
Numerical equality, under which NaN is unequal to every operand.
Instances For
Strict reverse comparison of decoded operands.
Instances For
Non-strict reverse comparison of decoded operands.
Instances For
Order of two decoded operands, or none when either is NaN.
Infinities are ordered at the ends of the extended reals and equal when their signs agree.
Instances For
Minimum with NaN propagation and the supplied final projection.
Instances For
Maximum with NaN propagation and the supplied final projection.
Instances For
Minimum with a numerical operand preferred to NaN.
Instances For
Maximum with a numerical operand preferred to NaN.
Instances For
Minimum magnitude, with negative sign preferred at a tie.
Instances For
Maximum magnitude, with positive sign preferred at a tie.
Instances For
Minimum magnitude with a numerical operand preferred to NaN.
Instances For
Maximum magnitude with a numerical operand preferred to NaN.
Instances For
Minimum preferring finite values to infinity and infinity to NaN.
Instances For
Maximum preferring finite values to infinity and infinity to NaN.