law divmod_value

bend-osdev-word64@0.1.1.0 · LAWS_div.bend:8

import bend-osdev-word64@0.1.1.0/LAWS_div.bend as LAWSDiv
import Base
import bend-osdev-word64@0.1.1.0/word64.bend as W

8# Division (shift and subtract, 64 steps): for b not 0, the quotient and the
9# remainder are the Nat ones, a = q b + r with r < b; by 0, the quotient is 0
10# and the remainder a.
11law divmod_value:
12  for +a: W.W64
13  for +b: W.W64
14  for h: {W.W64.is_zero(b) == False{} : Bool}
15  {Nat.add(Nat.mul(W.W64.to_nat(W.W64.div(a, b)), W.W64.to_nat(b)), W.W64.to_nat(W.W64.mod(a, b))) == W.W64.to_nat(a) : Nat}

Uses (15)

Used by (0)

No other definition uses this definition.