hex.inc1ΒΆ
hex++ (if overflows - jump to carry1; else jump to carry0)
SignatureΒΆ
def inc1 hex, carry0, carry1 @ switch, end { ... }
Defined in hex/math_basic.fj β lines 99β125 (view on GitHub).
ComplexityΒΆ
Time:
@Space:
1.5@+13
See the complexity glossary for what @, w, dw, dbit, n mean.
SourceΒΆ
Click to view the macro body
def inc1 hex, carry0, carry1 @ switch, end {
wflip hex+w, switch, hex
pad 16
switch:
hex+dbit+0;end // 0
hex+dbit+1;switch+0*dw // 1
hex+dbit+0;end // 2
hex+dbit+2;switch+1*dw // 3
hex+dbit+0;end // 4
hex+dbit+1;switch+0*dw // 5
hex+dbit+0;end // 6
hex+dbit+3;switch+3*dw // 7
hex+dbit+0;end // 8
hex+dbit+1;switch+0*dw // 9
hex+dbit+0;end // 10
hex+dbit+2;switch+1*dw // 11
hex+dbit+0;end // 12
hex+dbit+1;switch+0*dw // 13
hex+dbit+0;end // 14
hex+dbit+3; // 15
hex+dbit+2;
hex+dbit+1;
hex+dbit+0;
wflip hex+w, switch, carry1
end:
wflip hex+w, switch, carry0
}
Used byΒΆ
Example usesΒΆ
hex.inc.stepinhex/math_basic.fj
β Previous: hex.count_bits
Next: hex.inc β