The algorithm for expanding all real numbers
into so-called continued fractions is
explained in many texts in elementary number theory. Here
you can obtain the partial
fraction expansion for rational numbers with a
limit of about 5 digits on your choice of
numerator a and denominator b, below.
The intention is to show the connection with Euclid's method. Notice that the numbers that
run from right-to-left (in the conventional
notation the direction is from left-to-right) down the
side of the "stacked fraction" are
precisely the quotients obtained from Euclid's method.
They are called partial quotients. A continued fraction is thus
a single object which can embody all the
information of Euclid's algorithm.