Continued fraction arithmetic