Ordinal
represents a bounded value for second, which ranges between 0 and 59 or 60. This accounts
for potential leap second.
Equations
- Std.Time.Second.Ordinal leap = Std.Time.Internal.Bounded.LE 0 (Int.ofNat (if leap = true then 60 else 59))
Instances For
Equations
- Std.Time.Second.instBEqOrdinal = { beq := fun (x y : Std.Time.Second.Ordinal leap) => x.val == y.val }
Equations
- Std.Time.Second.instLEOrdinal = { le := fun (x y : Std.Time.Second.Ordinal leap) => x.val ≤ y.val }
Equations
- Std.Time.Second.instLTOrdinal = { lt := fun (x y : Std.Time.Second.Ordinal leap) => x.val < y.val }
Equations
- Std.Time.Second.instReprOrdinal = { reprPrec := fun (r : Std.Time.Second.Ordinal l) => reprPrec r.val }
instance
Std.Time.Second.instOfNatOrdinal
{leap : Bool}
{n : Nat}
:
OfNat (Std.Time.Second.Ordinal leap) n
Equations
- One or more equations did not get rendered due to their size.
Equations
- Std.Time.Second.instDecidableLeOrdinal = inferInstanceAs (Decidable (x.val ≤ y.val))
Equations
- Std.Time.Second.instDecidableLtOrdinal = inferInstanceAs (Decidable (x.val < y.val))
Equations
- Std.Time.Second.instOfNatOffset = { ofNat := Std.Time.Internal.UnitVal.ofNat n }
@[inline]
Creates an Second.Offset
from a natural number.
Equations
- Std.Time.Second.Offset.ofNat data = { val := ↑data }
Instances For
@[inline]
Creates an Second.Offset
from an integer.
Equations
- Std.Time.Second.Offset.ofInt data = { val := data }
Instances For
@[inline]
def
Std.Time.Second.Ordinal.ofInt
{leap : Bool}
(data : Int)
(h : 0 ≤ data ∧ data ≤ Int.ofNat (if leap = true then 60 else 59))
:
Creates an Ordinal
from an integer, ensuring the value is within bounds.
Equations
- Std.Time.Second.Ordinal.ofInt data h = Std.Time.Internal.Bounded.LE.mk data h
Instances For
@[inline]
def
Std.Time.Second.Ordinal.ofNat
{leap : Bool}
(data : Nat)
(h : data ≤ if leap = true then 60 else 59)
:
Creates an Ordinal
from a natural number, ensuring the value is within bounds.
Equations
- Std.Time.Second.Ordinal.ofNat data h = Std.Time.Internal.Bounded.LE.ofNat data h
Instances For
@[inline]
Creates an Ordinal
from a Fin
, ensuring the value is within bounds.
Equations
- Std.Time.Second.Ordinal.ofFin data_2 = Std.Time.Internal.Bounded.LE.ofFin data_2
- Std.Time.Second.Ordinal.ofFin data_2 = Std.Time.Internal.Bounded.LE.ofFin data_2
Instances For
@[inline]
Converts an Ordinal
to an Second.Offset
.
Equations
- ordinal.toOffset = { val := ordinal.val }