hex.print_intΒΆ
print the signed x[:n], without leading zeros.
x_prefix (constant): print with the β0xβ prefix.
use_uppercase (constant): if true, print in uppercase (else lowercase).
SignatureΒΆ
def print_int n, x, x_prefix, use_uppercase @ do_neg, print, neg, end { ... }
Defined in hex/output.fj β lines 198β213 (view on GitHub).
ComplexityΒΆ
Time:
n(2@+10)Space:
n(4.5@+71)
See the complexity glossary for what @, w, dw, dbit, n mean.
SourceΒΆ
Click to view the macro body
def print_int n, x, x_prefix, use_uppercase @ 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_uint n, x, x_prefix, use_uppercase
bit.if0 neg, end
.neg n, x
;end
neg: bit.bit
end:
}
Depends onΒΆ
β Previous: hex.print_uint.print_digit
Next: hex.print_dec_uint β