Description
Report its direction, strict start/stop nonemptiness, and max(0, ceil((stop - start) / step)) as count.
An index map tracks where one item lands after a structural list operation. Zero-based element positions differ from boundary cursors, and missing destinations need a sentinel.
Report its direction, strict start/stop nonemptiness, and max(0, ceil((stop - start) / step)) as count.
When to use this tool
Use List: List Slice Step Direction Check when you need one item's position under an explicit list transformation.
How to use the tool and how it works
- Enter start, stop, step. 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 nonzero signed step. Report its direction, strict start/stop nonemptiness, and max(0, ceil((stop - start) / step)) as count.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| start | Start | Required. Safe integer. |
| stop | Stop | Required. Safe integer. |
| step | Step | Required. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| result | Result | Required. Object. |
| result.direction | Direction | Calculated result member: string. |
| result.nonempty | Nonempty | Calculated result member: boolean. |
| result.count | Count | Calculated result member: number. |
{
"input": {
"start": 5,
"stop": 0,
"step": -2
},
"output": {
"result": {
"direction": "backward",
"nonempty": true,
"count": 3
}
}
} Limitations and assumptions
- Stops are exclusive; these raw signed coordinates are not normalized like language-specific slicing against an actual list length.
- 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
Apply the operation to a small representative list when checking a consuming language's indexing and slicing semantics.
References
Similar or alternative tools
- List: List Stride Last Valid Index
For positive stride, use max(0, ceil((stopExclusive - start) / stride)) as count.
- List Window Start End Bias
Choose anchor as the desired start or anchor - size as the desired start for end bias.