bit.addΒΆ
dst[:n] += src[:n]
dst,src are bit[:n]
SignatureΒΆ
def add n, dst, src @ carry { ... }
Defined in bit/math.fj β lines 80β86 (view on GitHub).
ComplexityΒΆ
Time:
n(8@+14)Space:
n(8@+14)
See the complexity glossary for what @, w, dw, dbit, n mean.
SourceΒΆ
Click to view the macro body
def add n, dst, src @ carry {
.zero carry
rep(n, i) .add1 dst+i*dw, src+i*dw, carry
stl.skip
carry:
.bit
}
Depends onΒΆ
Used byΒΆ
Example usesΒΆ
bit.mul10inbit/mul.fjbit.mul_loopinbit/mul.fjbit.mul.mul_add_ifinbit/mul.fj