hex.cmp (arity 6)¶

compares a[:n] to b[:n].
if a[:n]  < b[:n]:   goto lt;
if a[:n] == b[:n]:   goto eq;
if a[:n]  > b[:n]:   goto gt;

n is size-constant; a,b are hexes; lt/eq/gt are addresses.

Signature¶

def cmp n, a, b, lt, eq, gt { ... }

Defined in hex/cond_jumps.fj — lines 120–123 (view on GitHub).

Complexity¶

  • Time: m(3@+8)        // m=(n-i), where i is the most-significant index such that a[i] != b[i] (if a==b, then m==n).

  • Space: n(3@+30)

See the complexity glossary for what @, w, dw, dbit, n mean.

Requires init¶

The following must be initialised before this macro is invoked:

  • hex.cmp.init (or hex.init)

Depends on¶

Used by¶