TorchLean API

FloatLib.Floats.Formats.BinaryInterchange.Operations.TotalOrder.Magnitude

Total ordering by magnitude #

Magnitude comparison is a total preorder on complete data: mutual comparison identifies the absolute data, including NaN signaling status and payload. It agrees with absolute numerical comparison on finite operands. In signed-zero formats, including every IEEE encoding, it is exactly totalOrder (abs x) (abs y), as specified by IEEE 754-2019 §5.7.2.

Clearing a dyadic's sign computes the absolute value of its exact rational denotation.

Finite magnitude order compares absolute numerical values, then their exponents.

A strict increase in absolute numerical value gives magnitude ordering.

A strict decrease in absolute numerical value fails magnitude ordering.

NaN magnitudes place signaling before quiet, with increasing payloads within each class.

Magnitude comparison uses the same exact order for every binary descriptor.

IEEE's definition using encoded absolute value holds for every signed-zero format.

The encoded-absolute-value definition holds for every IEEE encoding, with arbitrary bias.

@[simp]

Magnitude order is reflexive on every binary datum.

Magnitude order is total, including NaN magnitudes.

Magnitude order is transitive for every descriptor.

Mutual magnitude comparison identifies absolute complete data, including NaN metadata.

For signed-zero formats, mutual magnitude comparison identifies absolute encoded words.

The full finite magnitude rule is uniform in format width, bias, and encoding policy.

Strict increase in absolute real value gives magnitude ordering for finite operands.

Strict decrease in absolute real value fails magnitude ordering for finite operands.

All zero signs have the same magnitude.

A NaN magnitude is strictly above every numerical magnitude, regardless of its sign.

Every numerical magnitude precedes every NaN magnitude.

NaN magnitude order ignores signs and compares signaling class before payload.

Magnitude equality of NaNs retains both signaling class and complete fraction payload.