*************************************************************************** ARBITRARY-PRECISION SIGNED INTEGER FRACTION ARITHMETIC DEMO =========================================================================== GIVEN THE TWO INTEGER FRACTION STRINGS BELOW, THE FOUR BASIC ARITHMETIC OPERATIONS (ADD, SUB, MUL and DIV) ARE PERFORMED ON THEM. REFRESH THIS PAGE FOR NEW RANDOMIZED EXAMPLE FRACTIONS. A/B = (15864064 / 3318) and C/D = (852 / 17423488) =========================================================================== ADD: (A/B) + (C/D) = (A*D + B*C) / (B*D) = E / F = (15864064 / 3318) + (852 / 17423488) Raw Fraction = 276407331562168 / 57811133184 GCD = 8 Reduced Fraction = 34550916445271 / 7226391648 Plain decimal value truncated at 50 decimals without rounding = 4781.21282768190756106663761050555227255238851399713120 =========================================================================== SUBTRACT: (A/B) − (C/D) = (A*D − B*C) / (B*D) = E / F = (15864064 / 3318) - (852 / 17423488) Raw Fraction = 276407325908296 / 57811133184 GCD = 8 Reduced Fraction = 34550915738537 / 7226391648 Plain decimal value truncated at 50 decimals without rounding = 4781.21272988289051006054744073013187452416362584614788 =========================================================================== MULTIPLY: (A/B)*(C/D) = (A*C) / (B*D) = E / F = (15864064 / 3318) * (852 / 17423488) Raw Fraction = 13516182528 / 57811133184 GCD = 23808 Reduced Fraction = 567716 / 2428223 Plain decimal value truncated at 50 decimals without rounding = 0.23379895503831402634766246757402429677999096458603 =========================================================================== DIVIDE: (A/B) / (C/D) = (A*D) / (B*C) = E / F = (15864064 / 3318) / (852 / 17423488) Raw Fraction = 276407328735232 / 2826936 GCD = 8 Reduced Fraction = 34550916091904 / 353367 Plain decimal value truncated at 50 decimals without rounding = 97776295.16028378428093172254341803281008130357390475058508 ===========================================================================