hex.print_dec_intΒΆ
prints x[:n] as a signed DECIMAL number (without leading zeros).
SignatureΒΆ
def print_dec_int n, x @ do_neg, print, neg, end { ... }
Defined in hex/output.fj β lines 230β245 (view on GitHub).
ComplexityΒΆ
Time:
nd(28@+48) + n(5@+4) (for d number of decimal digits)Space:
n(59@+98)
See the complexity glossary for what @, w, dw, dbit, n mean.
SourceΒΆ
Click to view the macro body
def print_dec_int n, x @ do_neg, print, neg, end {
bit.zero neg
.sign n, x, do_neg, print
do_neg:
bit.not neg
.neg n, x
stl.output '-'
print:
.print_dec_uint n, x
bit.if0 neg, end
.neg n, x
;end
neg: bit.bit
end:
}
Depends onΒΆ
β Previous: hex.print_dec_uint