lastdigit
Lastdigit is a term used to refer to the units digit of a number in base 10, i.e., the digit in the ones place. It is equivalent to the remainder after division by 10, often written as lastdigit(n) = n mod 10. For nonnegative integers, this gives the digit from 0 to 9 that ends the decimal representation. For negative integers, the last digit is typically understood as the last digit of the absolute value, or it can be defined via the nonnegative remainder mod 10; conventions vary.
The concept generalizes to the last k digits, which are the remainder when divided by 10^k. This
In arithmetic, the lastdigit is compatible with modulo operations: the last digit of a sum is the
Applications of the lastdigit include problem solving in number theory, pattern recognition in modular arithmetic, and