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. Inverse of hex.print_dec_uint.

Signature

def input_dec_uint n, dst, error @ loop, valid_hi, terminator, digit_char, add_digit, digit, byte, end { ... }

Defined in hex/input.fj — lines 102–124 (view on GitHub).

Complexity

  • Time: ~ d(n(10@+39)) + (d+1)(7@+11)    (d = number of input digits; estimate)

  • Space: ~ n(9@+132) + 8@+100             (estimate)

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

Depends on


← Previous: hex.input_as_hex/3 Next: hex.input_dec_int