Skip to content

Main content

Numeric Open Boundary Neighbor Tool

Return the adjacent finite binary64 value, with an explicit false flag when the next value would be infinite.

Loading tool…

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

  1. Enter boundary, direction. 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 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 fieldMeaning and unitsAccepted input
boundaryBoundaryRequired. Finite number.
directionDirectionRequired. Text; one of "above", "below"; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
neighborAdjacent finite value, or the unchanged boundary when representable is false.Required. Finite number.
representableWhether a finite strict neighbor exists in the requested direction.Required. Boolean.
json
{
  "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

  1. Calculation and input contract: validate/numeric-open-boundary-neighbor — tool.io

Similar or alternative tools