Half Open Interval Distance
Compute infimum distance between nonempty half-open intervals and distinguish zero-distance touching from attained overlap.
Description
Compute infimum distance between nonempty half-open intervals and distinguish zero-distance touching from attained overlap.
The distance between half-open intervals is the infimum separation of their points. Touching intervals can have zero distance without sharing any included point.
When to use this tool
Compute infimum distance between nonempty half-open intervals and distinguish zero-distance touching from attained overlap.
- Prepare the supplied aStart, aEnd, bStart, bEnd fields for this operation.
- Compare the complete example with the representation used by your own input before carrying the result into another step.
How to use the tool and how it works
- Enter aStart, aEnd, bStart, bEnd. Use the exact text syntax, units and index conventions explained below.
- Run the tool. If input validation fails, correct the supplied fields before interpreting any result.
- Read result.infimumDistance, result.attainedOverlap. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.
Require positive-length ordered intervals. Return the maximum of zero and the two directional endpoint gaps, and separately report whether their intersection has strictly positive length.1
| Input field | Meaning and representation | Accepted input |
|---|---|---|
| aStart | a start. | Finite number |
| aEnd | a end. | Finite number |
| bStart | b start. | Finite number |
| bEnd | b end. | Finite number |
| Output field | Interpretation |
|---|---|
| result | Object containing the named outputs below. |
| result.infimumDistance | The infimum distance value under the stated formula or text convention. |
| result.attainedOverlap | Flag for attained overlap under the exact condition described above. |
{
"input": {
"aStart": 0,
"aEnd": 2,
"bStart": 2,
"bEnd": 3
},
"output": {
"result": {
"infimumDistance": 0,
"attainedOverlap": false
}
}
} Limitations and assumptions
- A zero distance alone does not imply overlap: touching half-open intervals also return zero. Empty intervals are rejected and isolated-point distances are not modeled.
- Interval-array rows contain exactly two finite endpoints in start/end order, with at most 128 intervals per collection. Individual operations state when positive length, integer endpoints or explicit inclusion flags are required.
- Every declared top-level field is required and unexpected fields are rejected. Numeric inputs must be finite; ordinary text fields are bounded to 8,192 UTF-16 code units, with tighter operation-specific limits where stated.
- Ordinary string lists have at most 128 entries of at most 128 code units each; numeric lists and matrices have separate bounded size checks. Nonfinite results and excessively large serialized outputs are rejected.
- Indexes are zero-based and spans have an exclusive end unless explicitly stated otherwise. A valid false, null or empty-list result is distinct from malformed input.
Alternative or Complementary methods
Retain the endpoint convention with every result. Continuous length, integer point counts and open/closed membership differ; merge returned cells separately when a canonical minimal interval collection is required.
References
Similar or alternative tools
- Half Open Interval Overlap Length
Compute Lebesgue overlap length of half-open finite intervals; touching and empty intervals have zero length.
- Interval Endpoint Toggle Effect
Audit membership effect of toggling one interval endpoint closure; degenerate intervals still require both endpoint conditions.