Description
Reject when that midpoint is not representably inside [lower, upper); otherwise return midpoint and width.
Arithmetic coding narrows an interval according to cumulative symbol probabilities. Choosing a point or bit budget for that interval differs from implementing a practical integer range coder.
Reject when that midpoint is not representably inside [lower, upper); otherwise return midpoint and width.
When to use this tool
Use Arithmetic Code Final Interval Midpoint when you need one ideal interval-update or termination-budget term.
How to use the tool and how it works
- Enter lower, upper. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read midpoint, width. Use the output convention below.
Require 0 ≤ lower < upper ≤ 1 and form lower + (upper - lower)/2. Reject when that midpoint is not representably inside [lower, upper); otherwise return midpoint and width.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| lower | Lower | Required. Finite number; minimum 0. |
| upper | Upper | Required. Finite number; maximum 1. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| midpoint | Midpoint | Required. Finite number. |
| width | Width, count, or interval span under the stated formula. | Required. Finite number. |
{
"input": {
"lower": 0.25,
"upper": 0.5
},
"output": {
"midpoint": 0.375,
"width": 0.25
}
} Limitations and assumptions
- The value is floating point rather than an exact rational or encoded bit string; very narrow intervals can lack a usable computed midpoint.
- 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 a complete coding implementation with explicit precision, renormalization, and stream-termination rules.
References
Similar or alternative tools
- Arithmetic Code Single Symbol Subinterval
Scale each cumulative endpoint by current width and add current lower for the next lower and upper bounds.
- Arithmetic Code Interval Bit Bound
For width in (0, 1], return idealBits = -log2(width) and sufficientBits = ceil(idealBits) + 1.