Documentation

Std.Time.Internal.UnitVal

@[inline]

Creates a UnitVal from a Nat.

Equations
@[inline]

Converts a UnitVal to an Int.

Equations
@[inline]
def Std.Time.Internal.UnitVal.mul {a : Internal.Rat} (unit : UnitVal a) (factor : Int) :
UnitVal (a / { num := factor, den := 1 })

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

Equations
  • unit.mul factor = { val := unit.val * factor }
@[inline]
def Std.Time.Internal.UnitVal.ediv {a : Internal.Rat} (unit : UnitVal a) (divisor : Int) :
UnitVal (a * { num := divisor, den := 1 })

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

Equations
@[inline]
def Std.Time.Internal.UnitVal.tdiv {a : Internal.Rat} (unit : UnitVal a) (divisor : Int) :
UnitVal (a * { num := divisor, den := 1 })

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

Equations
@[inline]
def Std.Time.Internal.UnitVal.div {a : Internal.Rat} (unit : UnitVal a) (divisor : Int) :
UnitVal (a * { num := divisor, den := 1 })

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

Equations
@[inline]

Adds two UnitVal values of the same ratio.

Equations
@[inline]

Subtracts one UnitVal value from another of the same ratio.

Equations
@[inline]

Returns the absolute value of a UnitVal.

Equations
@[inline]

Converts an Offset to another unit type.

Equations