A structure representing a unit of a given ratio type α
.
- ofInt :: (
- val : Int
Value inside the UnitVal Value.
- )
Instances For
Equations
- Std.Time.Internal.instInhabitedUnitVal = { default := { val := default } }
Equations
- Std.Time.Internal.instBEqUnitVal = { beq := Std.Time.Internal.beqUnitVal✝ }
Equations
- Std.Time.Internal.instLEUnitVal = { le := fun (x_1 y : Std.Time.Internal.UnitVal x) => x_1.val ≤ y.val }
instance
Std.Time.Internal.instDecidableLeUnitVal
{z : Std.Internal.Rat}
{x y : Std.Time.Internal.UnitVal z}
:
Equations
- Std.Time.Internal.instDecidableLeUnitVal = inferInstanceAs (Decidable (x.val ≤ y.val))
@[inline]
Instances For
@[inline]
def
Std.Time.Internal.UnitVal.mul
{a : Std.Internal.Rat}
(unit : Std.Time.Internal.UnitVal a)
(factor : Int)
:
Std.Time.Internal.UnitVal (a / { num := factor, den := 1 })
Multiplies the UnitVal
by an Int
, resulting in a new UnitVal
with an adjusted ratio.
Instances For
@[inline]
def
Std.Time.Internal.UnitVal.ediv
{a : Std.Internal.Rat}
(unit : Std.Time.Internal.UnitVal a)
(divisor : Int)
:
Std.Time.Internal.UnitVal (a * { num := divisor, den := 1 })
Divides the UnitVal
by an Int
, resulting in a new UnitVal
with an adjusted ratio.
Instances For
@[inline]
def
Std.Time.Internal.UnitVal.div
{a : Std.Internal.Rat}
(unit : Std.Time.Internal.UnitVal a)
(divisor : Int)
:
Std.Time.Internal.UnitVal (a * { num := divisor, den := 1 })
Divides the UnitVal
by an Int
, resulting in a new UnitVal
with an adjusted ratio.
Instances For
@[inline]
Adds two UnitVal
values of the same ratio.
Instances For
@[inline]
Subtracts one UnitVal
value from another of the same ratio.
Instances For
@[inline]
Returns the absolute value of a UnitVal
.
Instances For
@[inline]
def
Std.Time.Internal.UnitVal.convert
{a b : Std.Internal.Rat}
(val : Std.Time.Internal.UnitVal a)
:
Converts an Offset
to another unit type.
Instances For
Equations
- Std.Time.Internal.UnitVal.instRepr = { reprPrec := fun (x : Std.Time.Internal.UnitVal α) (p : Nat) => reprPrec x.val p }
Equations
- Std.Time.Internal.UnitVal.instLE = { le := fun (x y : Std.Time.Internal.UnitVal α) => x.val ≤ y.val }
Equations
- Std.Time.Internal.UnitVal.instAdd = { add := Std.Time.Internal.UnitVal.add }