home *** CD-ROM | disk | FTP | other *** search
- To reduce a Fraction object to its simplest form, the numerator
- and denominator are divided by their greatest common divisor. The
- private member function gcd() takes two arguments and returns
- their greatest common divisor. Here, for example, if "num" has
- the value 6 and "denom" has the value 8, gcd() returns the value
- 2. Both "num" and "denom" are divided by 2. The resulting value,
- 3/4, is the value that is stored for the Fraction object.
-