Module digit

Source
Expand description

Utilities to process digits.

This both contains routines to convert to and from digits, as well as iterate over digits while skipping digit separators.

Functionsยง

char_is_digit
Determine if a character is a digit.
char_is_digit_const
Determine if a character is a digit with a radix known at compile time.
char_to_digit
Convert a character to a digit.
char_to_digit_const
Convert a character to a digit with a radix known at compile time.
char_to_valid_digit_const
Unchecked, highly optimized algorithm to convert a char to a digit. This only works if the input character is known to be a valid digit.
digit_to_char
Convert a digit to a character. This uses a pre-computed table to avoid branching.
digit_to_char_const
Convert a digit to a character with a radix known at compile time.