Skip to content

Main content

List Marker Delimited Span Endpoint Tool

Calculate list marker delimited span endpoint from explicit caller-supplied inputs.

Loading tool…

Description

Advance start by one when includeStart is false and advance end by one when includeEnd is true.

Half-open list ranges include their start and exclude their end. Empty and touching ranges can be disjoint even when their boundary coordinates coincide.

Advance start by one when includeStart is false and advance end by one when includeEnd is true.

When to use this tool

Use List Marker Delimited Span Endpoint when you need a precise range relationship for a list operation.

How to use the tool and how it works

  1. Enter start, end, includeStart, includeEnd. 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 first, exclusiveEnd, count. Use the output convention below.

Advance start by one when includeStart is false and advance end by one when includeEnd is true. Return first, exclusiveEnd, and their zero-floored difference.1

Input fieldMeaning and unitsAccepted input
startStartRequired. Safe integer; minimum 0.
endEndRequired. Safe integer.
includeStartInclude StartRequired. Boolean.
includeEndInclude EndRequired. Boolean.
Output fieldInterpretationReturned shape
firstFirst value or boundary under the stated formula.Required. Safe integer.
exclusiveEndExcluded terminal boundary of the indicated span.Required. Safe integer.
countCountRequired. Safe integer.
json
{
  "input": {
    "start": 2,
    "end": 6,
    "includeStart": false,
    "includeEnd": false
  },
  "output": {
    "first": 3,
    "exclusiveEnd": 6,
    "count": 3
  }
}

Limitations and assumptions

  • Equal marker positions can produce first greater than exclusiveEnd with count zero; list bounds are not supplied.
  • 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

  1. Calculation and input contract: list/list-marker-delimited-span-endpoint — tool.io

Similar or alternative tools