Skip to content

Main content

List Run Split At Cursor Tool

Calculate list run split at cursor from explicit caller-supplied inputs.

Loading tool…

Description

Return cursor as left and runLength minus cursor as right.

A list window uses a start and exclusive end or a center and radius. Boundary clamping, padding, and half-integer centers are separate conventions.

Return cursor as left and runLength minus cursor as right.

When to use this tool

Use List Run Split At Cursor when you need an explicit window position or edge-padding budget.

How to use the tool and how it works

  1. Enter runLength, cursor. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read left, right. Use the output convention below.

Require cursor between zero and runLength. Return cursor as left and runLength minus cursor as right.1

Input fieldMeaning and unitsAccepted input
runLengthRun LengthRequired. Safe integer; minimum 0.
cursorCursorRequired. Safe integer; minimum 0.
Output fieldInterpretationReturned shape
leftLeftRequired. Safe integer.
rightRightRequired. Safe integer.
json
{
  "input": {
    "runLength": 7,
    "cursor": 3
  },
  "output": {
    "left": 3,
    "right": 4
  }
}

Limitations and assumptions

  • The cursor is a boundary rather than an element index; empty sides and an empty run are allowed.
  • 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

Inspect actual list bounds and choose whether to shift, truncate, or pad windows before extracting data.

References

  1. Calculation and input contract: list/list-run-split-at-cursor — tool.io

Similar or alternative tools