hex.add_count_bits¶

(n=2 when operating on 16-255 bit-numbers)
dst[:n] += src.#on-bits (between 0->4)
dst is hex.vec n, src is hex.

Signature¶

def add_count_bits n, dst, src @ count_switch, do_add, add_switch, add4_switch, xor_switch, after_add, is_carry, should_inc, do_inc, clean { ... }

Defined in hex/math_basic.fj — lines 10–74 (view on GitHub).

Complexity¶

  • Time: 2.27@-1                // (2@-10 + 2 + 4 + 3 + 0.25*[16@/15])

  • Space: 0.5@+109 + n(1.5@+13)  // (2@-10 + 16(1+4+1+2) + 4 + (n-1)(1.5@+13))

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

Depends on¶