To be clear, the I implemented the function continued_fraction_rational_number just to help in the internal calculation process of the continued_fraction function.
However, I agree with you that it would be better if the function just took a single expression. I'm not clear whether you expect the user to input an expression like (1 + 2*sqrt(2))/4 or the value of the expression 0.9571067811865476. If it is the value, then I need to figure out a method to approximate the value back to the decimal square form right?