Description
For positive integer firstDenominator, secondDenominator, and budget return denominator=first+second and fits when denominator<=budget.
A rational number is represented by an integer numerator and a nonzero integer denominator. Sign placement, reduction by a greatest common divisor, and the chosen division or rounding convention affect intermediate representations. Exact integer text preserves arithmetic that could be lost in a floating-point conversion.
For positive integer firstDenominator, secondDenominator, and budget return denominator=first+second and fits when denominator<=budget.
When to use this tool
Use Rational Mediant Denominator Budget when you need this particular exact fraction comparison, reduction, sign, denominator, or rounding component.
How to use the tool and how it works
- Enter firstDenominator, secondDenominator, budget. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read denominator, fits. Inspect fits before interpreting the associated values.
For positive integer firstDenominator, secondDenominator, and budget return denominator=first+second and fits when denominator<=budget.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| firstDenominator | First Denominator | Required. Safe integer; minimum 1. |
| secondDenominator | Second Denominator | Required. Safe integer; minimum 1. |
| budget | Budget | Required. Safe integer; minimum 1. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| denominator | Denominator or exact integer denominator text under the stated sign restriction. | Required. Safe integer. |
| fits | Fits | Required. Boolean. |
{
"input": {
"firstDenominator": 3,
"secondDenominator": 5,
"budget": 10
},
"output": {
"denominator": 8,
"fits": true
}
} Limitations and assumptions
- This checks an unreduced mediant denominator only. It does not account for numerator cancellation, calculate a reduced rational, or guarantee that an intermediate sum fits the safe numeric range.
- 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
Reduce fractions where the interpretation requires it and choose a consistent denominator-sign and division convention. Use a complete rational operation when one denominator or determinant term is insufficient.
References
Similar or alternative tools
- Rational Addition Denominator Lcm Factor
For positive integer first and second compute their gcd by Euclidean remainder, lcm=(first/gcd)*second, and require that lcm remain a positive safe integer.
- Rational Dyadic Denominator Flag
Reduce a supplied exact rational before testing whether its denominator is a power of two.