--- from: http://rosettacode.org/wiki/Continued_fraction