Fraction Between Integer Bounds

Check exact rational membership in caller-supplied inclusive integer bounds without decimal approximation.

Description

Check exact rational membership in caller-supplied inclusive integer bounds without decimal approximation.

An exact fraction can be tested against inclusive integer bounds through multiplication rather than decimal conversion.

When to use this tool

Check exact rational membership in caller-supplied inclusive integer bounds without decimal approximation.

  • Prepare the supplied numerator, denominator, minimum, maximum 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 numerator, denominator, minimum, maximum. 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.inside. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.

Normalize n/d with positive d, parse ordered minimum and maximum integer strings, and test minimum*d at most n at most maximum*d.1

Input fieldMeaning and representationAccepted input
numeratorExact signed decimal integer text; denominator fields must be nonzero.Optional + or - and 1 to 256 decimal digits
denominatorExact signed decimal integer text; denominator fields must be nonzero.Optional + or - and 1 to 256 decimal digits
minimumExact decimal integer text; keep it quoted in JSON rather than converting through a floating-point number.Optional leading + or - and 1 to 256 decimal digits; no whitespace
maximumExact decimal integer text; keep it quoted in JSON rather than converting through a floating-point number.Optional leading + or - and 1 to 256 decimal digits; no whitespace
Output fieldInterpretation
resultObject containing the named outputs below.
result.insideFlag for inside under the exact condition described above.
json
{
  "input": {
    "numerator": "5",
    "denominator": "2",
    "minimum": "2",
    "maximum": "3"
  },
  "output": {
    "result": {
      "inside": true
    }
  }
}

Limitations and assumptions

  • Bounds are inclusive. The tool does not round the fraction or choose an interval from data.
  • Numerator and denominator fields use exact decimal integer strings of at most 256 digits with an optional sign. Fractions are reduced with a positive denominator before the stated operation.
  • All declared input fields are required and unexpected top-level fields are rejected. Numbers must be finite; lists are limited to 128 entries and ordinary text fields to 8,192 UTF-16 code units, with tighter limits where stated.
  • JSON text inputs must parse within bounded nesting and size limits. Numeric outputs outside the safe finite range are rejected; large exact integer results use decimal strings. Indexes and half-open spans are zero-based unless a rank is explicitly described as one-based.

Alternative or Complementary methods

Use exact numerator/denominator operations when equality and boundary decisions matter. Convert to a decimal display only with an explicit rounding policy; a rounded display should not replace the exact result.

References

  1. Tool behavior and example: Fraction Between Integer Bounds — tool.io

Similar or alternative tools

  • Fraction Floor and Remainder

    Split an exact rational into mathematical floor and a nonnegative reduced fractional remainder; signed numerators are not truncated toward zero.

  • Fraction Nearest Integer Tie Policy

    Round an exact fraction to a nearest integer with explicit half-even, away-from-zero or positive-infinity tie policy.

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