hex.sub.sub_constant_with_leading_zeros¶
Internal helper for hex.sub_constant: strips const’s trailing zero nibbles, then subtracts the result from dst[:n] at the matching nibble offset (so the trailing zeros are skipped instead of materialised as wasted-work subtractions).
n_const is the minimal hex.vec size needed to store const.
Signature¶
def sub_constant_with_leading_zeros n, dst, const, leading_lsb_const_zeros { ... }
Defined in hex/math.fj — lines 193–195 (view on GitHub).
Complexity¶
Time:
n_const(4@+12) + 5@+2Space:
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¶
Click to view the macro body
def sub_constant_with_leading_zeros n, dst, const, leading_lsb_const_zeros {
.sub_hex_shifted_constant n, dst, const >> (leading_lsb_const_zeros & (0-4)), leading_lsb_const_zeros >> 2
}
Depends on¶
Used by¶
Example uses¶
hex.sub_constantinhex/math.fj
← Previous: hex.sub_constant
Next: hex.sub.sub_hex_shifted_constant/4 →