randRange( 1, 5 ) randRange( 1, 4 ) randRange( NUM_1 + 1, 5 ) randRange( 1, 5 ) randRange( 1, 4 ) randRange( NUM_2 + 1, 5 ) WHOLE_1 * DENOM_1 + NUM_1 DENOM_1 WHOLE_2 * DENOM_2 + NUM_2 DENOM_2 I_NUM_1*I_NUM_2 I_DENOM_1*I_DENOM_2 (I_NUM_1*I_NUM_2)/getGCD(I_NUM, I_DENOM) (I_DENOM_1*I_DENOM_2)/getGCD(I_NUM,I_DENOM) roundTowardsZero(I_NUM/I_DENOM) (I_NUM/I_DENOM)-WHOLE_3 roundTo(0,NUM_3_DEC*I_DENOM) I_DENOM NUM_3/getGCD(NUM_3,DENOM_3) DENOM_3/getGCD(NUM_3,DENOM_3)
Multiply, reduce to lowest terms, and turn into a mixed number:

\displaystyleWHOLE_1\ fraction( NUM_1, DENOM_1, false, true ) \times WHOLE_2\ fraction( NUM_2, DENOM_2, false, true )

(WHOLE_3 + (NUM_3_SIMP/DENOM_3_SIMP))

a mixed number, like 1 3/4

Turn the mixed numbers into improper fractions to make it easier to multiply them.

Let's start with the first mixed number: To find the numerator of the improper fraction, multiply the denominator (DENOM_1) by the whole number (WHOLE_1) and add the numerator (NUM_1). DENOM_1*WHOLE_1+NUM_1 = I_NUM_1.

So the first mixed number can be written as fraction( I_NUM_1, I_DENOM_1, false, true ).

Now let's turn the second mixed number into an improper fraction: To find the numerator, multiply the denominator (DENOM_2) by the whole number (WHOLE_2) and add the numerator (NUM_2). DENOM_2*WHOLE_2+NUM_2 = I_NUM_2.

So the second mixed number can be written as fraction( I_NUM_2, I_DENOM_2, false, true ).

Multiply the two improper fractions: fraction( I_NUM_1, I_DENOM_1, false, true ) * fraction( I_NUM_2, I_DENOM_2, false, true )\displaystyle {} = fraction( I_NUM, I_DENOM )

mixedFractionFromImproper(I_NUM_SIMP, I_DENOM_SIMP)

Turn the improper fraction into a mixed number:

First, divide the numerator by the denominator. I_NUM \div I_DENOM = \color{#28AE7B}{WHOLE_3}\ \text{ R } \color{purple}{NUM_3}

So the improper fraction has WHOLE_3 wholes in it.

This quotient WHOLE_3 is the whole number part of the mixed number.

We also have a remainder of NUM_3, though. That represents the \dfrac{\color{purple}{NUM_3}}{DENOM_3} remaining from the improper fraction; it wasn't enough to be another whole number.

The converted mixed fraction is \color{#28AE7B}{WHOLE_3}\ \color{purple}{fraction( NUM_3, DENOM_3, false, true )}.