Description
Parse the signed decimal integer exactly, take its absolute value modulo ten, and classify that last digit as even or odd.
Decimal strings can represent integers exactly beyond the safe range of ordinary floating-point numbers. Parsing their sign and digits preserves integer arithmetic, while converting the result to a floating-point number may lose precision.
Parse the signed decimal integer exactly, take its absolute value modulo ten, and classify that last digit as even or odd.
When to use this tool
Use Integer Parity Last Digit Witness when you need an exact integer-string operation under the supported lexical grammar.
How to use the tool and how it works
- Enter integerDecimal. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read lastDigit, parity. Use the output convention below.
Parse the signed decimal integer exactly, take its absolute value modulo ten, and classify that last digit as even or odd.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| integerDecimal | Integer Decimal | Required. Text; maximum UTF-16 length 8192. Integer syntax: optional + or - and 1-128 decimal digits; leading zeros accepted. Apply the sign restriction above. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| lastDigit | Last Digit | Required. Safe integer. |
| parity | Parity | Required. Text; maximum UTF-16 length 8192. |
{
"input": {
"integerDecimal": "-123456789123456789"
},
"output": {
"lastDigit": 9,
"parity": "odd"
}
} Limitations and assumptions
- Leading zeros and a plus sign are accepted by the shared integer parser; no fixed-width or floating-point conversion is used.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Keep large results as decimal strings and use an arbitrary-precision integer library for further exact arithmetic.
References
Similar or alternative tools
- Integer Canonical Sign Token
Parse the decimal integer exactly and return negative, positive, or zero plus its absolute decimal magnitude.
- Set Element Power Weight
Require safe-integer index from zero through 4096 and return 2^index using exact integers as weightDecimal.