bit.div_loopΒΆ

Compact unsigned integer division (slower than bit.div, but uses much less program space): q = a/b, r = a%b. Jumps to end if b==0.

SignatureΒΆ

def div_loop n, a, b, q, r @ loop, do_sub, loop_end, after_loop, A, Q, R, i, end { ... }

Defined in bit/div.fj β€” lines 207–243 (view on GitHub).

ComplexityΒΆ

  • Time: n^2(18@+18)

  • Space: n(25@+22)

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

SourceΒΆ

Depends onΒΆ

Used byΒΆ

Example usesΒΆ


← Previous: bit.idiv_loop