Numeric Interval Inclusion Flag

Check membership in a finite interval with independently specified open/closed endpoints, including degenerate intervals.

Description

Check membership in a finite interval with independently specified open/closed endpoints, including degenerate intervals.

Interval membership depends on whether each endpoint is included. Separate flags let the same ordered bounds represent closed, open or half-open intervals.

When to use this tool

Check membership in a finite interval with independently specified open/closed endpoints, including degenerate intervals.

  • Prepare the supplied start, end, value, startClosed, endClosed 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

  1. Enter start, end, value, startClosed, endClosed. Use the exact text syntax, units and index conventions explained below.
  2. Run the tool. If input validation fails, correct the supplied fields before interpreting any result.
  3. Read result.included. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.

Check value against start using startClosed and against end using endClosed, then combine both comparisons. Ordered equal bounds are accepted.1

Input fieldMeaning and representationAccepted input
startstart.Finite number
endend.Finite number
valuevalue.Finite number
startClosedExplicit choice for start closed; supply a boolean rather than a text label.true or false
endClosedExplicit choice for end closed; supply a boolean rather than a text label.true or false
Output fieldInterpretation
resultObject containing the named outputs below.
result.includedFlag for included under the exact condition described above.
json
{
  "input": {
    "start": 1,
    "end": 3,
    "value": 1,
    "startClosed": false,
    "endClosed": true
  },
  "output": {
    "result": {
      "included": false
    }
  }
}

Limitations and assumptions

  • A degenerate interval contains its sole coordinate only when both endpoints are closed. Exact floating-point comparison is used without tolerance or unit conversion.
  • 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

  1. Tool behavior and example: Numeric Interval Inclusion Flag — tool.io

Similar or alternative tools

  • Interval Affine Transform

    Affine-transform interval endpoints, reorder the image bounds and retain negative-scale orientation reversal.

  • Interval Clamp and Empty Audit

    Audit raw clipped interval bounds and emptiness; disjoint intersections retain start>end as evidence, not a fabricated nonempty interval.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies