I am working with classes in C++ and I can get the math part of it down. The problem I am having is figuring a way to reduce a fraction within a function say for instance I needed to reduce a fraction to the lowest term
Like for example:
10/12 to reduce to 5/6 I can get the math to get to 10/12 but I am trying to figure out how I could write a function to reduce any fraction of any size. Even if I had an example like 25/6 this would remain 25/6 because I am not mixing reduced fractions.
Any suggestions???
Like for example:
10/12 to reduce to 5/6 I can get the math to get to 10/12 but I am trying to figure out how I could write a function to reduce any fraction of any size. Even if I had an example like 25/6 this would remain 25/6 because I am not mixing reduced fractions.
Any suggestions???