Description
Identify an exact discarded-decimal half tie and the retained-digit parity adjustment for ties-to-even.
Decimal rounding and scale alignment depend on retained places, discarded digits, tie rules, and the number of rounding stages. A decimal spacing is different from the binary floating-point spacing of a runtime number. Text-based digit operations can preserve widths that disappear when a value is parsed numerically.
Identify an exact discarded-decimal half tie and the retained-digit parity adjustment for ties-to-even.
When to use this tool
Use Decimal Tie To Even Parity Flag when you need this specific decimal tie, scale, digit-carry, spacing, or staged-rounding check.
How to use the tool and how it works
- Enter retainedDigit, discardedDigits. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read tie, increment. Inspect tie, increment before interpreting the associated values.
Require retainedDigit in 0..9 and nonempty decimal discardedDigits. Set tie when discardedDigits is 5 followed only by zeros, and increment only when tie and retainedDigit is odd.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| retainedDigit | Retained Digit | Required. Safe integer; minimum 0; maximum 9. |
| discardedDigits | Discarded Digits | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| tie | Tie | Required. Boolean. |
| increment | True only on an exact half tie with an odd retained digit; not a full round-up rule. | Required. Boolean. |
{
"input": {
"retainedDigit": 3,
"discardedDigits": "500"
},
"output": {
"tie": true,
"increment": true
}
} Limitations and assumptions
- Increment is a tie-to-even decision only. False on a discarded suffix above half, such as 6, is not an instruction to round down; general rounding and carry propagation are outside scope.
- 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.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Use an exact decimal representation when binary floating-point rounding is inadequate. Apply a complete rounding rule rather than treating a tie-only flag or digit-count term as the whole decision.
References
Similar or alternative tools
- Decimal Place Carry Cascade Count
Increment a nonnegative decimal digit string while retaining its minimum width and counting trailing-nine carries.
- Decimal Double Rounding Witness
Demonstrate explicit Math.round half-toward-positive-infinity decimal rounding; this tool intentionally compares rounding policies.