Description
Return the adjacent finite binary64 value, with an explicit false flag when the next value would be infinite.
A number written as decimal text and a JavaScript binary floating-point number have different representation limits. Safe-integer range, exact representability, and adjacent floating-point values are distinct concepts. A boundary helper needs to state which one it tests and what an unavailable result means.
Return the adjacent finite binary64 value, with an explicit false flag when the next value would be infinite.
When to use this tool
Use Numeric Open Boundary Neighbor when you need the specific numerical range or representation property under the stated number convention.
How to use the tool and how it works
- Enter boundary, direction. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read neighbor, representable. Inspect representable before interpreting the associated values.
Return the adjacent finite binary64 value above or below boundary by updating its bit pattern. At zero use plus or minus Number.MIN_VALUE; if the next value would be infinite, return boundary unchanged with representable false.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| boundary | Boundary | Required. Finite number. |
| direction | Direction | Required. Text; one of "above", "below"; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| neighbor | Adjacent finite value, or the unchanged boundary when representable is false. | Required. Finite number. |
| representable | Whether a finite strict neighbor exists in the requested direction. | Required. Boolean. |
{
"input": {
"boundary": 1,
"direction": "above"
},
"output": {
"neighbor": 1.0000000000000002,
"representable": true
}
} Limitations and assumptions
- Representable must be checked before treating neighbor as a strict neighbor. This is binary floating-point adjacency, not the next decimal increment, an integer-only step, or a tolerance chosen for an application.
- The field tables state structural bounds; the mechanics also specify cross-field constraints. Malformed inputs and unsupported domains cause errors. A successful false flag, empty branch value, or zero placeholder has the meaning stated above and is distinct from an input error.
- 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. Signed zero is exported as zero.
Alternative or Complementary methods
Choose exact decimal-integer arithmetic for integer-range questions and explicit floating-point analysis for representable-neighbor questions. Match the method to the numerical property being tested.
References
Similar or alternative tools
- Integer Boundary Representability
Parse decimalToken as a bounded signed decimal integer and return safeInteger when it lies within JavaScript's inclusive safe-integer limits.
- BCP 47 Extlang Subtag Boundary
Split a language-tag-shaped string into language, up to three extlang-shaped parts, and a remainder.