hex.sub_shiftedΒΆ
dst[:dst_n] -= src[:src_n] << (4*hex_shift)
SignatureΒΆ
def sub_shifted dst_n, src_n, dst, src, hex_shift @ do_dec, end { ... }
Defined in hex/math.fj β lines 175β182 (view on GitHub).
ComplexityΒΆ
Time:
src_n(4@+12) + 5@+10 // It's on average, see the note in hex.inc.Space:
src_n(2.5@+39) + (dst_n - hex_shift)(1.5@+13) + 4@+40
See the complexity glossary for what @, w, dw, dbit, n mean.
Requires initΒΆ
The following must be initialised before this macro is invoked:
hex.sub.init (or hex.init)
SourceΒΆ
Click to view the macro body
def sub_shifted dst_n, src_n, dst, src, hex_shift @ do_dec, end {
.sub.clear_carry
rep(src_n, i) .sub dst+(hex_shift + i)*dw, src+i*dw
.sub.clear_carry end, do_dec
do_dec:
rep(dst_n - (src_n + hex_shift), i) .dec.step dst+(src_n + hex_shift + i)*dw, end
end:
}
Depends onΒΆ
Used byΒΆ
Example usesΒΆ
hex.sub.sub_hex_shifted_constantinhex/math.fj
β Previous: hex.sub/3
Next: hex.sub_constant β