Sturmian word: Difference between revisions

Content added Content deleted
Line 27: Line 27:


== {{header|Phix}} ==
== {{header|Phix}} ==
Rational part translated from Python, quadratic part modified from the [[Continued fraction convergents]] task.
Rational part translated from Python, quadratic part a modified copy of the [[Continued fraction convergents]] task.
<!--(phixonline)-->
<!--(phixonline)-->
<syntaxhighlight lang="Phix">
<syntaxhighlight lang="Phix">
Line 67: Line 67:
sequence p = {0, 1},
sequence p = {0, 1},
q = {1, 0}
q = {1, 0}
atom r = (sqrt(a)*b + m) / n,
atom rem = (sqrt(a)*b + m) / n
rem = r
for i=1 to k do
for i=1 to k do
integer whole = trunc(rem),
integer whole = trunc(rem),