Lets say I have two continued fractions: $$a=[a_0; \overline{a_1, a_2,a_3...}]$$ $$b=[b_0; \overline{b_1, b_2,b_3...}]$$ How do I add them together?
Asked
Active
Viewed 204 times
1
-
1You could compose conversion to decimal, decimal addition, and conversion back to continued fraction. All of these can be done in a "streaming" fashion so that you only read elements as you need them to produce output. – Karl Dec 15 '21 at 03:34
-
5See Item 101B in HAKMEM for Gosper's algorithms for addition, subtraction, multiplication, and division of continued fractions. – Eric Towers Dec 15 '21 at 05:22
-
@EricTowers I didn't see that before. Thank you! – Aaron Speedy Dec 15 '21 at 12:57
-
Possible duplicate of this question – Redu May 17 '22 at 20:18