hex.input_dec_int_until

dst[:n] = the signed decimal number read from input (two’s complement, mod 16^n).

Reads an optional leading '-', then ASCII '0'..'9', and STOPS at the first non-digit byte, which gets stored in stop_byte[:2] (note that a leading '+' stops with dst=0). The primitive behind hex.input_dec_int.

Signature

def input_dec_int_until n, dst, stop_byte @ sign_hi, do_minus, loop, digit_lo, add_digit, finish, digit, neg, end { ... }

Defined in hex/input.fj — lines 126–156 (view on GitHub).

Complexity

  • Time: ~ nd(10@+39)    (d = number of digits)

  • Space: ~ n(10.5@+149)

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

Used by

Example uses


← Previous: hex.input_dec_uint_until Next: hex.input_dec_uint