64-bit two's complement integers #
Arithmetic wraps, so beware (not really, our uses are formally checked).
Fast conversion from ℕ
Equations
- instNatCastInt64_interval = { natCast := fun (n : ℕ) => (UInt64.ofNat n).toInt64 }
Fast conversion from ℤ
Equations
- instIntCastInt64_interval = { intCast := fun (n : ℤ) => Int64.ofInt n }
Int64 is a commutative ring.
We don't use CommRing.ofMinimalAxioms, since we want our own Sub` instance.
Equations
- One or more equations did not get rendered due to their size.
Int64 < is decidable
Equations
- decidableLT x✝¹ x✝ = id inferInstance
Int64 ≤ is decidable
Equations
- decidableLE x✝¹ x✝ = id inferInstance
Conditions for ℤ conversion to commute with arithmetic #
@[simp]
Conversion from ℕ is secretly the same as conversion to UInt64
@[simp]
UInt64.log2 converts to ℤ as toNat
Order lemmas #
Int64 min (must be defined before LinearOrder)
Int64 max (must be defined before LinearOrder)
Int64 is a linear order (though not an ordered algebraic structure)
Equations
- One or more equations did not get rendered due to their size.
Shims for proof backwards compatibility #
Order operations: min, abs #
Left shift #
Right shift, rounding up or down #
@[simp]
0.shiftRightRound = 0
Int64.shiftRightRound rounds correctly
Int64.shiftRightRound reduces abs
Int64.shiftRightRound never produces min from scratch