bit.div

Unsigned integer division: q = a/b, r = a%b. Jumps to end if b==0. q, a, b, r are bit[:n]. Wasteful in space — prefer hex.div for serious work.

Signature

def div n, a, b, q, r @ Q, R, end { ... }

Defined in bit/div.fj — lines 111–127 (view on GitHub).

Complexity

  • Time: n^2(10@+20)

  • Space: n^2(11@+22)

See the complexity glossary for what @, w, dw, dbit, n mean.

Source

Depends on

Used by

Example uses


← Previous: bit.idiv Next: bit.div.div_step