Description
Find the next explicitly continuing preference; does not conduct or certify an election count.
Election and representation indicators depend on the selected vote, seat, population, or eligibility denominator. A threshold also needs an explicit equality and rounding rule. A single quotient, balance, or share can support a larger counting workflow without implementing the full electoral procedure.
Find the next explicitly continuing preference; does not conduct or certify an election count.
When to use this tool
Use Ballot Exhaustion Last Preference Token when you need this particular counting term under an explicit vote, seat, threshold, or reporting-base rule.
How to use the tool and how it works
- Enter preferences, continuing. Keep parallel arrays aligned. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read exhausted, nextPreference, preferenceIndex. Inspect exhausted before interpreting the associated values.
Find the first exact preference token present in continuing. Return its zero-based preferenceIndex and nextPreference, or exhausted=true, preferenceIndex=-1, and nextPreference="" when none exists.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| preferences | Preferences | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| continuing | Continuing | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| exhausted | Exhausted | Required. Boolean. |
| nextPreference | Next Preference | Required. Text; maximum UTF-16 length 8192. |
| preferenceIndex | Zero-based first continuing preference, or -1 if exhausted. | Required. Safe integer. |
{
"input": {
"preferences": [
"A",
"B",
"C"
],
"continuing": [
"C"
]
},
"output": {
"exhausted": false,
"nextPreference": "C",
"preferenceIndex": 2
}
} Limitations and assumptions
- An empty string may itself be a valid supplied token, so inspect exhausted and preferenceIndex. Rankings are not deduplicated or validated as a complete ballot.
- 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
Compare the supplied counting rule with the authoritative procedure for the relevant election or chamber. Complete allocations need additional eligibility, ranking, transfer, tie, and reporting rules beyond one arithmetic term.
References
Similar or alternative tools
- Ballot Exhaustion Share
Audit supplied ballot disposition counts under an explicit denominator convention.
- Ballot Transfer Exhaustion One Round
For nonnegative integer transferable, exhausted within transferable, and nonnegative integer receivedByCandidates, return continuing=sum(receivedByCandidates), accounted=exhausted+continuing, and balanced=(accounted===transferable).