Each component is first expanded in a continued fraction of the
form
x = floor(x) + 1/(p1 + 1/(p2 + …)))
where p1
, p2
, … are positive integers, terminating either
at cycles
terms or when a pj > max.denominator
. The
continued fraction is then re-arranged to retrieve the numerator
and denominator as integers and the ratio returned as the value.