Skip to content

Main content

Integer Boundary Representability Tool

Calculate integer boundary representability from explicit caller-supplied inputs.

Loading tool…

Description

Parse decimalToken as a bounded signed decimal integer and return safeInteger when it lies within JavaScript's inclusive safe-integer limits.

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.

Parse decimalToken as a bounded signed decimal integer and return safeInteger when it lies within JavaScript's inclusive safe-integer limits.

When to use this tool

Use Integer Boundary Representability 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 decimalToken. 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 safeInteger. Inspect safeInteger before interpreting the associated values.

Parse decimalToken as a bounded signed decimal integer and return safeInteger when it lies within JavaScript's inclusive safe-integer limits.1

Input fieldMeaning and unitsAccepted input
decimalTokenDecimal TokenRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
safeIntegerWhether the exact integer lies within the safe-integer range; not a general exact-representability test.Required. Boolean.
json
{
  "input": {
    "decimalToken": "9007199254740992"
  },
  "output": {
    "safeInteger": false
  }
}

Limitations and assumptions

  • This tests the safe-integer range, not whether a larger particular integer happens to have an exact binary64 representation. Input syntax excludes exponent notation and decimals; no numeric conversion is returned.
  • 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/integer-boundary-representability — tool.io

Similar or alternative tools