Documentation

Std.Time.Internal.UnitVal

A structure representing a unit of a given ratio type α.

  • ofInt :: (
    • val : Int

      Value inside the UnitVal Value.

  • )
Instances For
    theorem Std.Time.Internal.UnitVal.ext {α : Rat} {x y : UnitVal α} (val : x.val = y.val) :
    x = y
    theorem Std.Time.Internal.UnitVal.ext_iff {α : Rat} {x y : UnitVal α} :
    x = y x.val = y.val
    def Std.Time.Internal.instDecidableEqUnitVal.decEq {α✝ : Rat} (x✝ x✝¹ : UnitVal α✝) :
    Decidable (x✝ = x✝¹)
    Equations
    Instances For
      @[inline]

      Creates a UnitVal from a Nat.

      Equations
      Instances For
        @[inline]

        Converts a UnitVal to an Int.

        Equations
        Instances For
          @[inline]
          def Std.Time.Internal.UnitVal.mul {a : Rat} (unit : UnitVal a) (factor : Int) :
          UnitVal (a / factor)

          Multiplies the UnitVal by an Int, resulting in a new UnitVal with an adjusted ratio.

          Equations
          Instances For
            @[inline]
            def Std.Time.Internal.UnitVal.ediv {a : Rat} (unit : UnitVal a) (divisor : Int) :
            UnitVal (a * divisor)

            Divides the UnitVal by an Int, resulting in a new UnitVal with an adjusted ratio. Using the E-rounding convention (euclidean division)

            Equations
            Instances For
              @[inline]
              def Std.Time.Internal.UnitVal.tdiv {a : Rat} (unit : UnitVal a) (divisor : Int) :
              UnitVal (a * divisor)

              Divides the UnitVal by an Int, resulting in a new UnitVal with an adjusted ratio. Using the "T-rounding" (Truncation-rounding) convention

              Equations
              Instances For
                @[inline]
                def Std.Time.Internal.UnitVal.div {a : Rat} (unit : UnitVal a) (divisor : Int) :
                UnitVal (a * divisor)

                Divides the UnitVal by an Int, resulting in a new UnitVal with an adjusted ratio.

                Equations
                Instances For
                  @[inline]
                  def Std.Time.Internal.UnitVal.add {α : Rat} (u1 u2 : UnitVal α) :

                  Adds two UnitVal values of the same ratio.

                  Equations
                  Instances For
                    @[inline]
                    def Std.Time.Internal.UnitVal.sub {α : Rat} (u1 u2 : UnitVal α) :

                    Subtracts one UnitVal value from another of the same ratio.

                    Equations
                    Instances For
                      @[inline]

                      Returns the absolute value of a UnitVal.

                      Equations
                      Instances For
                        @[inline]

                        Converts an Offset to another unit type.

                        Equations
                        Instances For
                          def Std.Time.Internal.UnitVal.cast {a b : Rat} :
                          a = b(x : UnitVal a) → UnitVal b

                          Cast a UnitVal through an equality in the rational numbers.

                          Equations
                          Instances For