There are many ways to compute pi, but the continued fraction
expansion given in the course packet appears to be one of the
simples and most useful for getting a good rational approximation.
For the extra credit, you will probably want to implement some of the optional
interface functions in
RAT.h.
However, you may not add your own.
Enrichment Links
There are other ways to compute rational approximations to
e and π. The following are accurate to an amazing 16 decimal places:
e = 28245729/10391023, π = 245850922/78256779.