20 Jul
2019
20 Jul
'19
12:18 p.m.
In[74]:= ContinuedFraction[-π, 6] Out[74]= {-3, -7, -15, -1, -292, -1} vs the conventional In[75]:= MapAt[# - 4 &, ContinuedFraction[4 - π, 6], 1] Out[75]= {-4, 1, 6, 15, 1, 292} Nonpositive noninitial terms lose uniqueness, and the elegant definition cf[1/0] = {}; cf[x_] := Join[{Floor@x}, cf[1/(x - Floor@x)]] cf[-99/70] {-2, 1, 1, 2, 2, 2, 2} In Mma, adding or subtracting an integer can change *all* the terms. What would Knuth say? —rwg