Description
Require start and end independently within [0, length] and return max(0, end - start).
Half-open list ranges include their start and exclude their end. Empty and touching ranges can be disjoint even when their boundary coordinates coincide.
Require start and end independently within [0, length] and return max(0, end - start).
When to use this tool
Use List: List Half Open Slice Length when you need a precise range relationship for a list operation.
How to use the tool and how it works
- Enter start, end, length. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read result. Expand result to inspect the returned fields.
Require start and end independently within [0, length] and return max(0, end - start).1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| start | Start | Required. Safe integer. |
| end | End | Required. Safe integer. |
| length | Length, count, or code length under the stated domain and unit convention. | Required. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| result | Result | Required. Object. |
| result.sliceLength | Slice Length | Calculated result member: number. |
{
"input": {
"start": 2,
"end": 5,
"length": 8
},
"output": {
"result": {
"sliceLength": 3
}
}
} Limitations and assumptions
- Reversed endpoints yield zero instead of being swapped or rejected; endpoints are half open.
- Outputs are nested inside result. 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 Marker Delimited Span Endpoint
Advance start by one when includeStart is false and advance end by one when includeEnd is true.
- List Circular Slice Length
Return the forward modular distance from start to end.