Skip to content

Main content

List Swap Range Disjointness Flag Tool

Calculate list swap range disjointness flag from explicit caller-supplied inputs.

Loading tool…

Description

Mark disjoint for either empty range or nonoverlapping endpoints; touching independently checks equal opposing endpoints.

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

Mark disjoint for either empty range or nonoverlapping endpoints; touching independently checks equal opposing endpoints.

When to use this tool

Use List Swap Range Disjointness Flag when you need a precise range relationship for a list operation.

How to use the tool and how it works

  1. Enter firstStart, firstEnd, secondStart, secondEnd. 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 disjoint, touching. Inspect disjoint, touching before interpreting the associated values.

Require ordered nonnegative half-open ranges. Mark disjoint for either empty range or nonoverlapping endpoints; touching independently checks equal opposing endpoints.1

Input fieldMeaning and unitsAccepted input
firstStartFirst StartRequired. Safe integer; minimum 0.
firstEndFirst EndRequired. Safe integer.
secondStartSecond StartRequired. Safe integer; minimum 0.
secondEndSecond EndRequired. Safe integer.
Output fieldInterpretationReturned shape
disjointDisjointRequired. Boolean.
touchingTouchingRequired. Boolean.
json
{
  "input": {
    "firstStart": 1,
    "firstEnd": 3,
    "secondStart": 3,
    "secondEnd": 5
  },
  "output": {
    "disjoint": true,
    "touching": true
  }
}

Limitations and assumptions

  • Empty ranges are disjoint even when located inside another range; no list length or swap feasibility is validated.
  • 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-swap-range-disjointness-flag — tool.io

Similar or alternative tools