Method and source check
Last checked:
Automated source and implementation review, including worked examples and documented numerical limits. This review does not provide professional advice or specialist approval.
Method
Multiply the first fraction by the reciprocal of the nonzero second fraction. Reduce the result, normalize its denominator to positive, and optionally show a correctly signed mixed number.
(a/b) ÷ (c/d) = ad/(bc), c ≠ 0
gcd(|ad|,|bc|) reduces the fraction
Variables and units
- a,b
- first numerator and nonzero denominator
- c,d
- second numerator and nonzero denominator
Worked example
1/2 ÷ 3/4 = 1/2 × 4/3 = 4/6 = 2/3; the displayed decimal is 0.666667.
Limitations
Decimal is rounded to six places; simplified fraction remains exact for supported integer inputs.
- Integer fraction inputs are expected.
- A negative result must not be presented with an ambiguous mixed-number sign.
- Inputs and the numerator/denominator cross-products must be safe integers (absolute value at most 9,007,199,254,740,991). Unsupported division is rejected rather than shown as an exact fraction.
- Division by a zero-valued fraction is undefined.
- A negative result has the sign on the whole mixed value.
- 9007199254740991/1 ÷ 1/3 is rejected because the numerator product exceeds the supported integer range.