Ask Your Question

# Revision history [back]

Indeed, a continued fraction is just a representation of a real number. It does not make much sense to mix these considerations with arithmetic. In the particular case you mentioned you would better do

sage: continued_fraction(3*pi)
[9; 2, 2, 1, 4, 1, 1, 1, 97, 4, 1, 2, 1, 2, 45, 6, 4, 9, 1, 27, ...]


However, the operation continued_fraction(x) -> continued_fraction(3*x) can be much faster than the above (and 3 * continued_fraction(x) might be a shortcut for that). There is a ticket for that purpose: #19120.