TorchLean API

FloatLib.Floats.Formats.P3109.Arithmetic.Extrema.Runtime

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 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 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
                      @[inline]

                      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
                        @[inline]

                        Strict comparison of decoded operands, with NaN unordered.

                        Instances For
                          @[inline]

                          Non-strict comparison of decoded operands, with NaN unordered.

                          Instances For
                            @[inline]

                            Numerical equality, under which NaN is unequal to every operand.

                            Instances For
                              @[inline]

                              Strict reverse comparison of decoded operands.

                              Instances For
                                @[inline]

                                Non-strict reverse comparison of decoded operands.

                                Instances For
                                  @[inline]

                                  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
                                    @[inline]

                                    Minimum with NaN propagation and the supplied final projection.

                                    Instances For
                                      @[inline]

                                      Maximum with NaN propagation and the supplied final projection.

                                      Instances For
                                        @[inline]

                                        Minimum with a numerical operand preferred to NaN.

                                        Instances For
                                          @[inline]

                                          Maximum with a numerical operand preferred to NaN.

                                          Instances For
                                            @[inline]

                                            Minimum magnitude, with negative sign preferred at a tie.

                                            Instances For
                                              @[inline]

                                              Maximum magnitude, with positive sign preferred at a tie.

                                              Instances For
                                                @[inline]

                                                Minimum magnitude with a numerical operand preferred to NaN.

                                                Instances For
                                                  @[inline]

                                                  Maximum magnitude with a numerical operand preferred to NaN.

                                                  Instances For
                                                    @[inline]

                                                    Minimum preferring finite values to infinity and infinity to NaN.

                                                    Instances For
                                                      @[inline]

                                                      Maximum preferring finite values to infinity and infinity to NaN.

                                                      Instances For