Skip to content

Main content

List Neighbor Gap Cyclic Endpoint Tool

Calculate list neighbor gap cyclic endpoint from explicit caller-supplied inputs.

Loading tool…

Description

Return period minus the last position plus the first for wrapGap.

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 period minus the last position plus the first for wrapGap.

When to use this tool

Use List Neighbor Gap Cyclic Endpoint when you need a precise range relationship for a list operation.

How to use the tool and how it works

  1. Enter positions, period. 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 wrapGap. Use the output convention below.

Require strictly increasing positions in [0, period). Return period minus the last position plus the first for wrapGap.1

Input fieldMeaning and unitsAccepted input
positionsPositionsRequired. Array of finite number; maximum items 256.
periodPeriodRequired. Finite number; strictly above 0.
Output fieldInterpretationReturned shape
wrapGapWrap GapRequired. Finite number.
json
{
  "input": {
    "positions": [
      2,
      5,
      8
    ],
    "period": 10
  },
  "output": {
    "wrapGap": 4
  }
}

Limitations and assumptions

  • A singleton returns a full-period gap; duplicate or unsorted positions are rejected.
  • 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-neighbor-gap-cyclic-endpoint — tool.io

Similar or alternative tools