Description
Test integer membership in a supplied numeric interval with independently open or closed endpoints.
Exact integer arithmetic and finite numeric arithmetic have different range limits. A safe integer number is bounded by +/-9007199254740991, while supported decimal-integer text can represent larger values. Division and remainder also need a signed convention: truncating quotients and Euclidean nonnegative remainders can give different results.
Test integer membership in a supplied numeric interval with independently open or closed endpoints.
When to use this tool
Use Integer Square Bracket Containment when you need this exact stated integer sign, bound, division, comparison, or factor component.
How to use the tool and how it works
- Enter integer, lower, upper, includeLower, includeUpper. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read inside. Inspect inside before interpreting the associated values.
For ordered numeric lower<=upper return inside using >= or > at the lower boundary and <= or < at the upper boundary according to includeLower and includeUpper.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| integer | Safe integer number or exact signed decimal-integer text as declared below. | Required. Safe integer. |
| lower | Numeric lower bound; need not be an integer. | Required. Finite number. |
| upper | Numeric upper bound; need not be an integer. | Required. Finite number. |
| includeLower | Include Lower | Required. Boolean. |
| includeUpper | Include Upper | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| inside | Inside | Required. Boolean. |
{
"input": {
"integer": 3,
"lower": 2,
"upper": 3,
"includeLower": true,
"includeUpper": false
},
"output": {
"inside": false
}
} Limitations and assumptions
- Despite the tool name, this is ordinary interval membership, not squaring, square-root bracketing, or verification that an integer is a perfect square. Equal bounds can describe an empty interval under an open endpoint policy.
- 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
Use exact decimal-integer tools when the range exceeds safe numeric integers. State the division, remainder, midpoint, and zero convention before combining results from different operations.
References
Similar or alternative tools
- Rational Floor Ceiling Gap
Use exact integer division, lower the quotient by one for a nonintegral negative ratio, and return floor and ceiling as decimal text plus gap zero for integral ratios or one otherwise.
- Integer Square Neighbor Gap Pair
For nonnegative decimal-integer value use exact binary search to find lowerRoot=floor(sqrt(value)).