fraction(N1, D1) \div fraction(N2, D2)
\left(fraction(N1, D1) \div fraction(N2, D2)\right) \div fraction(N3, D3)
fraction(N1, D1) \div \left(fraction(N2, D2) \div fraction(N3, D3)\right) = {?}
First, we can simplify the problem:
fractionReduce(N1, D1) \div fractionReduce(N2, D2)
\left(fractionReduce(N1, D1) \div fractionReduce(N2, D2)\right) \div fractionReduce(N3, D3)
fractionReduce(N1, D1) \div \left(fractionReduce(N2, D2) \div fractionReduce(N3, D3)\right)
= {?}
Dividing by a fraction is the same as multiply by the reciprocal of that fraction.
\qquad =
fractionReduce(N1, D1) \times fractionReduce(D2, N2)
\left(fractionReduce(N1, D1) \times fractionReduce(D2, N2)\right) \div fractionReduce(N3, D3)
fractionReduce(N1, D1) \div \left(fractionReduce(N2, D2) \times fractionReduce(D3, N3)\right)
\qquad =
\dfrac{N1 / F1 \times
D2 / F2-D2 / F2}
{D1 / F1 \times abs(N2) / F2}
\left(\dfrac{N1 / F1 \times
D2 / F2-D2 / F2}
{D1 / F1 \times abs(N2) / F2}\right) \div fractionReduce(N3, D3)
fractionReduce(N1, D1) \div
\left(\dfrac{N2 / F2 \times
D3 / F3-D3 / F3}
{D2 / F2 \times abs(N3) / F3}\right)
\qquad =
fraction(SUB_N, SUB_D) \div fractionReduce(N3, D3)
fractionReduce(N1, D1) \div fraction(SUB_N, SUB_D)
\qquad =
fraction(SUB_N, SUB_D) \times fractionReduce(D3, N3)
fractionReduce(N1, D1) \times fraction(SUB_D, SUB_N)
\qquad =
\dfrac{SUB_N \times D3 / F3}{SUB_D \times N3 / F3}
\dfrac{N1 / F1 \times SUB_D}{D1 / F1 \times SUB_N}
\qquad = fraction(NUMERATOR, DENOMINATOR)
Simplify:
\qquad = fractionReduce(NUMERATOR, DENOMINATOR)
D1 \div D2
(D1 \div D2) \div D3
D1 \div (D2 \div D3)
\qquad = D1 \times (D3 \div D2)
\qquad = (D1 \times D3) \div D2
\qquad = roundTo(4, D1 * D3) \div D2
\qquad = D1 \div (D2 \times D3)
\qquad = D1 \div roundTo(4, D2 * D3)
Since both DIVIDEND_D
and DIVISOR_D
are negative, the result is positive.
A positive number divided by a negative number is a negative number.
A negative number divided by a positive number is a negative number.
DIVIDEND_D \div DIVISOR_D = SOLUTION
roundTo(2, D1*100)\% \div roundTo(2, D2 * 100)\%
(roundTo(2, D1 * 100)\% \div roundTo(2, D2 * 100)\%) \div roundTo(2, D3 * 100)\%
roundTo(2, D1 * 100)\% \div (roundTo(2, D2 * 100)\% \div roundTo(2, D3 * 100)\%)
\ \%
Convert each percentage into a decimal dividing by 100
.
D1 \div D2
(D1 \div D2) \div D3
D1 \div (D2 \div D3)
\qquad = D1 \times (D3 \div D2)
\qquad = (D1 \times D3) \div D2
\qquad = roundTo(4, D1 * D3) \div D2
\qquad = D1 \div (D2 \times D3)
\qquad = D1 \div roundTo(4, D2 * D3)
Since both DIVIDEND_D
and DIVISOR_D
are negative, the result is positive.
A positive number divided by a negative number is a negative number.
A negative number divided by a positive number is a negative number.
DIVIDEND_D \div DIVISOR_D = SOLUTION
Convert the decimal into a percentage by multiplying by 100
.
SOLUTION = roundTo(10, SOLUTION * 100)\%
INTEGERS[0].\overline{REPEATS[0]} \div INTEGERS[1].\overline{REPEATS[1]} = {?}
NUMERATOR / DENOMINATOR
First convert the repeating decimals to fractions.
\begin{align*}
pow(10, DIGITS[i])LETTERS[i] &= floorTo(4, DECIMALS[i] * pow(10, DIGITS[i]))...\\
LETTERS[i] &= floorTo(4, DECIMALS[i])...\end{align*}
\begin{align*}
DENOMINATORS[i]LETTERS[i] &= NUMERATORS[i] \\
LETTERS[i] &= fraction(NUMERATORS[i], DENOMINATORS[i])\end{align*}
So, the problem becomes:
fraction(NUMERATORS[0], DENOMINATORS[0]) \div fraction(NUMERATORS[1], DENOMINATORS[1]) = {?}
Dividing by a fraction is the same as multiply by the reciprocal of that fraction.
fraction(NUMERATORS[0], DENOMINATORS[0]) \times fraction(DENOMINATORS[1], NUMERATORS[1]) = {?}
\phantom{fraction(NUMERATORS[0], DENOMINATORS[0]) \times fraction(NUMERATORS[1], DENOMINATORS[1])}
= \dfrac{NUMERATORS[0] \times DENOMINATORS[1]}{DENOMINATORS[0] \times NUMERATORS[1]}
\phantom{fraction(NUMERATORS[0], DENOMINATORS[0]) \times fraction(NUMERATORS[1], DENOMINATORS[1])}
= \dfrac{NUMERATORS[0] \times \cancel{DENOMINATORS[1]}F2}
{\cancel{DENOMINATORS[0]}F1 \times NUMERATORS[1]}
\phantom{fraction(NUMERATORS[0], DENOMINATORS[0]) \times fraction(NUMERATORS[1], DENOMINATORS[1])}
= fraction(NUMERATOR, DENOMINATOR)
Simplify:
\large{= fractionReduce(NUMERATOR / GCD, DENOMINATOR / GCD)}