bit.mul_loop¶
dst[:n] *= src[:n]
b is the number of 1-bits in src.
@NOTE: this implementation works with both signed and unsigned numbers.
@NOTE: this is slower, yet it saves space, compared to the mul macro.
Signature¶
def mul_loop n, dst, src @ start, after_add, src_copy, res, end { ... }
Defined in bit/mul.fj — lines 24–45 (view on GitHub).
Complexity¶
Time:
n^2(6@+2) + n*b(8@+14) if b==n/2: n^2(10@+9)Space:
n(21@+11)
See the complexity glossary for what @, w, dw, dbit, n mean.