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 {α : Internal.Rat} {x y : UnitVal α} (val : x.val = y.val) :
    x = y
    @[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 : Internal.Rat} (unit : UnitVal a) (factor : Int) :
            UnitVal (a / { num := 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 : Internal.Rat} (unit : UnitVal a) (divisor : Int) :
                UnitVal (a * { num := 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 : Internal.Rat} (unit : UnitVal a) (divisor : Int) :
                    UnitVal (a * { num := 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 : Internal.Rat} (unit : UnitVal a) (divisor : Int) :
                        UnitVal (a * { num := divisor })

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

                        Equations
                          Instances For
                            @[inline]

                            Adds two UnitVal values of the same ratio.

                            Equations
                              Instances For
                                @[inline]

                                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