Post Reply 
(12C) Add or Subtract Fractions
09-19-2018, 12:19 PM (This post was last modified: 09-19-2018 01:39 PM by Albert Chan.)
Post: #3
RE: (12C) Add or Subtract Fractions
(09-19-2018 07:55 AM)Gamo Wrote:  Remark: This Multiply or Divide program will not work with negative fractions.

Try this challenging example: 676/13 x 3117/22

Answer: 81042/11 or 7367+ 5/11

Even on a fast 12C+ took about 10 seconds to compute.

Why is above a challenging example ?

gcd(676*3117, 13*22) = gcd(2107092, 286) = gcd(130, 286) = gcd(130, 26) = 26 should not take long ...

-> fraction = (2107092/26) / (286/26) = 81042 / 11

BTW, there is no need to implement fraction division
Just replace CHS with X<>Y , multiply fraction inverse = fraction division
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(12C) Add or Subtract Fractions - Gamo - 09-17-2018, 05:49 AM
RE: (12C) Add or Subtract Fractions - Gamo - 09-19-2018, 07:55 AM
RE: (12C) Add or Subtract Fractions - Albert Chan - 09-19-2018 12:19 PM
RE: (12C) Add or Subtract Fractions - Gamo - 09-25-2018, 02:36 AM



User(s) browsing this thread: 1 Guest(s)