bit.cmp (arity 6)ΒΆ
Three-way compare on n-bit vectors: jumps to lt if a[:n]<b[:n], eq if equal, gt if a[:n]>b[:n].
SignatureΒΆ
def cmp n, a, b, lt, eq, gt { ... }
Defined in bit/cond_jumps.fj β lines 80β83 (view on GitHub).
ComplexityΒΆ
Time:
n(2@+4)Space:
n(3@+6)
See the complexity glossary for what @, w, dw, dbit, n mean.
SourceΒΆ
Click to view the macro body
def cmp n, a, b, lt, eq, gt {
rep(n-1, i) ._.cmp_next_eq a+(n-1-i)*dw, b+(n-1-i)*dw, lt, gt
.cmp a, b, lt, eq, gt
}
Depends onΒΆ
Used byΒΆ
Example usesΒΆ
bit.hex2asciiinbit/casting.fjbit.ascii2bininbit/casting.fjbit.ascii2decinbit/casting.fj
β Previous: bit.cmp/5
Next: bit._.cmp_next_eq β