bit.mul¶

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 faster, yet WASTEFUL in space, compared to the mul_loop macro.

Signature¶

def mul n, dst, src @ shifted_src, res, end { ... }

Defined in bit/mul.fj — lines 54–67 (view on GitHub).

Complexity¶

  • Time: n*b(8@+14)    if b==n/2:  n^2(4@+7)

  • Space: n^2(8@+14)

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

Depends on¶