Nat8
8-bit unsigned integers with checked arithmetic
Most operations are available as built-in operators (e.g. 1 + 1
).
toNat
let toNat : Nat8 -> Nat
Conversion.
fromNat
let fromNat : Nat -> Nat8
Conversion. Traps on overflow/underflow.
fromIntWrap
let fromIntWrap : Int -> Nat8
Conversion. Wraps on overflow/underflow.
toText
func toText(x : Nat8) : Text
Returns the Text representation of x
.
bittest
func bittest(x : Nat8, p : Nat) : Bool
Returns the value of bit p mod 8
in x
, (x & 2^(p mod 8)) == 2^(p mod 8)
.