Description
Return the forward modular distance from start to end.
Half-open list ranges include their start and exclude their end. Empty and touching ranges can be disjoint even when their boundary coordinates coincide.
Return the forward modular distance from start to end.
When to use this tool
Use List Circular Slice Length when you need a precise range relationship for a list operation.
How to use the tool and how it works
- Enter length, start, end, fullWhenEqual. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read sliceLength. Use the output convention below.
Return the forward modular distance from start to end. At equal endpoints choose positive length or zero according to fullWhenEqual.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| length | Length, count, or code length under the stated domain and unit convention. | Required. Safe integer; minimum 1. |
| start | Start | Required. Safe integer; minimum 0. |
| end | End | Required. Safe integer; minimum 0. |
| fullWhenEqual | Full When Equal | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| sliceLength | Slice Length | Required. Safe integer. |
{
"input": {
"length": 8,
"start": 6,
"end": 2,
"fullWhenEqual": false
},
"output": {
"sliceLength": 4
}
} Limitations and assumptions
- Only one cycle is represented; endpoint equality alone cannot infer the intended traversal.
- 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
Validate ranges against the actual list length and the operation's overlap policy before mutating data.
References
Similar or alternative tools
- List: List Half Open Slice Length
Require start and end independently within [0, length] and return max(0, end - start).
- List Neighbor Gap Cyclic Endpoint
Return period minus the last position plus the first for wrapGap.