The size of type UInt256
, that is, 2^256
.
Equations
- EvmYul.UInt256.size = 115792089237316195423570985008687907853269984665640564039457584007913129639936
Instances For
Equations
- EvmYul.instBEqUInt256 = { beq := EvmYul.beqUInt256✝ }
Equations
- EvmYul.instOrdUInt256 = { compare := EvmYul.ordUInt256✝ }
Equations
- EvmYul.instToStringUInt256 = { toString := fun (a : EvmYul.UInt256) => toString a.val }
Equations
- EvmYul.UInt256.ofNat n = Id.run { val := Fin.ofNat n }
Instances For
Equations
- EvmYul.UInt256.instRepr = { reprPrec := fun (n : EvmYul.UInt256) (x : ℕ) => repr n.toNat }
Equations
- EvmYul.UInt256.instOfNatFinSize = { ofNat := Fin.ofNat n }
Equations
- EvmYul.UInt256.instInhabited = { default := EvmYul.UInt256.ofNat 0 }
@[reducible, inline]
Equations
Instances For
@[reducible, inline]
Instances For
Equations
Instances For
Equations
- EvmYul.UInt256.instAdd = { add := EvmYul.UInt256.add }
Equations
- EvmYul.UInt256.instSub = { sub := EvmYul.UInt256.sub }
Equations
- EvmYul.UInt256.instMul = { mul := EvmYul.UInt256.mul }
Equations
- EvmYul.UInt256.instDiv = { div := EvmYul.UInt256.div }
Equations
- EvmYul.UInt256.instMod = { mod := EvmYul.UInt256.mod }
Equations
- EvmYul.UInt256.instHModNat = { hMod := EvmYul.UInt256.modn }
Equations
- EvmYul.UInt256.instLT = { lt := fun (a b : EvmYul.UInt256) => a.val < b.val }
Equations
- EvmYul.UInt256.instLE = { le := fun (a b : EvmYul.UInt256) => a.val ≤ b.val }
Equations
- a.complement = { val := 0 - (a.val + 1) }
Instances For
Equations
- a.lnot = EvmYul.UInt256.ofNat (EvmYul.UInt256.size - 1) - a
Instances For
Equations
Instances For
Equations
- EvmYul.UInt256.instComplement = { complement := EvmYul.UInt256.complement }
Equations
- b.pow n = EvmYul.UInt256.powAux✝ { val := 1 } b ↑n.val
Instances For
Equations
- EvmYul.UInt256.instHPow = { hPow := EvmYul.UInt256.pow }
Equations
- EvmYul.UInt256.instAndOp = { and := EvmYul.UInt256.land }
Equations
- EvmYul.UInt256.instOrOp = { or := EvmYul.UInt256.lor }
Equations
- EvmYul.UInt256.instXor = { xor := EvmYul.UInt256.xor }
Equations
- EvmYul.UInt256.instShiftLeft = { shiftLeft := EvmYul.UInt256.shiftLeft }
Equations
- EvmYul.UInt256.instShiftRight = { shiftRight := EvmYul.UInt256.shiftRight }
Equations
- a.decLt b = inferInstanceAs (Decidable (a < b))
Instances For
Equations
- a.decLe b = inferInstanceAs (Decidable (a ≤ b))
Instances For
Equations
- a.instDecidableLt b = a.decLt b
Equations
- a.instDecidableLe b = a.decLe b
Equations
- EvmYul.UInt256.bigUInt = EvmYul.UInt256.ofNat 115792089237316195423570985008687907853269984665640564039457584007913129639935
Instances For
@[reducible, inline]
Equations
Instances For
Equations
- a.slt b = EvmYul.UInt256.fromBool (a.sltBool b)
Instances For
Equations
- a.sgt b = EvmYul.UInt256.fromBool (a.sgtBool b)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- a.lt b = EvmYul.UInt256.fromBool (decide (a < b))
Instances For
Equations
- a.gt b = EvmYul.UInt256.fromBool (decide (a > b))
Instances For
Equations
- a.eq b = EvmYul.UInt256.fromBool (decide (a = b))
Instances For
Equations
Instances For
Equations
- EvmYul.fromBytes' [] = 0
- EvmYul.fromBytes' (b :: bs) = ↑b.toFin + 2 ^ 8 * EvmYul.fromBytes' bs
Instances For
Instances For
Equations
Instances For
Instances For
Equations
- EvmYul.fromBytes! bs = EvmYul.fromBytes' (List.take 32 bs)
Instances For
Equations
- EvmYul.fromBytes_if_you_really_must? bs = { val := ⟨EvmYul.fromBytes! bs, ⋯⟩ }
Instances For
Equations
- EvmYul.toBytes! n = EvmYul.zeroPadBytes✝ 32 (EvmYul.toBytes'✝ ↑n.val)