hex.dec1ΒΆ
hex-- (if underflows - jump to borrow1; else jump to borrow0)
SignatureΒΆ
def dec1 hex, borrow0, borrow1 @ switch, borrow, end { ... }
Defined in hex/math_basic.fj β lines 145β172 (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 dec1 hex, borrow0, borrow1 @ switch, borrow, end {
wflip hex+w, switch, hex
pad 16
switch:
hex+dbit+3;borrow // 0
hex+dbit+0;end // 1
hex+dbit+1;switch+1*dw // 2
hex+dbit+0;end // 3
hex+dbit+2;switch+2*dw // 4
hex+dbit+0;end // 5
hex+dbit+1;switch+1*dw // 6
hex+dbit+0;end // 7
hex+dbit+3;switch+4*dw // 8
hex+dbit+0;end // 9
hex+dbit+1;switch+1*dw // 10
hex+dbit+0;end // 11
hex+dbit+2;switch+2*dw // 12
hex+dbit+0;end // 13
hex+dbit+1;switch+1*dw // 14
hex+dbit+0;end // 15
borrow:
hex+dbit+2;
hex+dbit+1;
hex+dbit+0;
wflip hex+w, switch, borrow1
end:
wflip hex+w, switch, borrow0
}
Used byΒΆ
Example usesΒΆ
hex.dec.stepinhex/math_basic.fj
β Previous: hex.inc.step
Next: hex.dec β