I'm assuming he's going to use continued fractions to find the best rational approximation to a given floating-point number.
Why not just use continued fractions directly? https://en.wikipedia.org/wiki/Continued_fraction#Calculating...
e.g.
p = 3.141592653589793
= 3 + 1 / 7.062513305931052
= 3 + 1 / (7 + 1 / 15.996594406684103)
= 3 + 1 / (7 + 1 / (15 + 1 / 1.0034172310150002))
= 3 + 1 / (7 + 1 / (15 + 1 / (1 + 1/292.63459087501246)))
so the continued fraction coefficients are 3;7;15;1;292 (see http://mathworld.wolfram.com/PiContinuedFraction.html or https://en.wikipedia.org/wiki/Continued_fraction#Continued_f...) and can be converted to rationals at each step using the semiconvergent recursion formula https://en.wikipedia.org/wiki/Continued_fraction#Semiconverg... to get approximants 3/1, 22/7,(3 + 15 * 22) / (1 + 15 * 7) = 333/106,
(22 + 1 * 333) / (7 + 1 * 106) = 355/113,
(333 + 292 * 355) / (106 + 292 * 113) = 103993/33102,
etc.