hex.input_dec_uint¶
dst[:n] = the unsigned decimal number read from input (mod 16^n).
Reads ASCII ‘0’..’9’ until a ‘\n’ or ‘\0’ (EOF) terminator; jumps to error on any other byte.
Signature¶
def input_dec_uint n, dst, error @ valid_lo, stopper, ok { ... }
Defined in hex/input.fj — lines 163–171 (view on GitHub).
Complexity¶
Time:
~ nd(10@+39) (d = number of digits)Space:
~ n(9@+150)
See the complexity glossary for what @, w, dw, dbit, n mean.
Requires init¶
The following must be initialised before this macro is invoked:
hex.init
Source¶
Click to view the macro body
def input_dec_uint n, dst, error @ valid_lo, stopper, ok {
.input_dec_uint_until n, dst, stopper
.if_flags stopper+dw, 1<<0, error, valid_lo // terminator high nibble must be 0
valid_lo:
.if_flags stopper, (1<<0x0)|(1<<0xA), error, ok // low nibble 0 ('\0') or A ('\n')
stopper: hex.vec 2
ok:
}
Depends on¶
← Previous: hex.input_dec_int_until
Next: hex.input_dec_int →