hex.add.add_constant_with_leading_zeros

Internal helper for hex.add_constant: strips const’s trailing zero nibbles, then adds the result back into dst[:n] at the matching nibble offset (so the trailing zeros are skipped instead of materialised as wasted-work additions).

n_const is the minimal hex.vec size needed to store const.

Signature

def add_constant_with_leading_zeros n, dst, const, leading_lsb_const_zeros { ... }

Defined in hex/math.fj — lines 50–52 (view on GitHub).

Complexity

  • Time: n_const(4@+12) + 5@+2

  • Space: n_const(2.5@+39) + (dst_n - hex_shift)(1.5@+13) + 4@+29

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

Source

Depends on


← Previous: hex.add_constant Next: hex.add.add_hex_shifted_constant/4