bit.shr (arity 3)ΒΆ
x[:n] >>= times
times is a constant.
@Assumes: times <= n
@Assumes: times <= n
SignatureΒΆ
def shr n, times, x { ... }
Defined in bit/shifts.fj β lines 15β18 (view on GitHub).
ComplexityΒΆ
Time:
n(2@-1)Space:
n(2@-1)
See the complexity glossary for what @, w, dw, dbit, n mean.
SourceΒΆ
Click to view the macro body
def shr n, times, x {
rep(n-times, i) .mov x+i*dw, x+(i+times)*dw
.zero times, x+(n-times)*dw
}
Depends onΒΆ
Used byΒΆ
Example usesΒΆ
bit.shrinbit/shifts.fj