bit.idiv_loopΒΆ

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

SignatureΒΆ

def idiv_loop n, a, b, q, r @ negative_a, negative_b, one_negative, neg_b_1, do_div, neg_b_2, neg_ans, end { ... }

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

ComplexityΒΆ

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

  • Space: n(37@+58)

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

SourceΒΆ

Depends onΒΆ


← Previous: bit.div.div_step Next: bit.div_loop β†’