How could we convert a rational number (less than $1$) to the continued fraction form?
This is probably an extension of this question. After reading Bill Dubuque's answer here and here, I got curious about continued fractions and tried myself to convert rationals into continued fractions. I noticed that for rational numbers greater than $1$ we could use extended Euclid theorem for gcd computation (manually), but I am not sure how to do the same for rationals less than $1$. Any ideas?
The recursion for computing the continued fraction expansion $\rm\:\langle x \rangle\:$ of a real $\rm\:x > 0\ $ is as follows
$$\rm \langle x\rangle\ =\ \lfloor x\rfloor\ + \dfrac{1}{\langle (x-\lfloor x\rfloor)^{-1}\rangle}\:,\qquad where\ \ \ \lfloor x\rfloor\ :=\ floor(x)\ $$
For example
$$\rm \bigg\langle\frac{3}{8}\bigg\rangle\ \ =\ \ 0\: +\: \cfrac{1}{\bigg\langle\cfrac{8}3\bigg\rangle}\ \ =\ \ 0 \:+\: \cfrac{1}{2 + \cfrac{1}{\bigg\langle\cfrac{3}2\bigg\rangle}}\ \ =\ \ 0\: +\: \cfrac{1}{2 + \cfrac{1}{1 + \cfrac{1}2}} $$