Continued fraction: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
(→jq: Fix comment) |
||
Line 1,809: | Line 1,809: | ||
which may be 0, as previously noted. |
which may be 0, as previously noted. |
||
<syntaxhighlight lang="jq"> |
<syntaxhighlight lang="jq"> |
||
# "first" is the first triple, |
# "first" is the first triple, e.g. [1,a,b]; |
||
# |
# "count" specifies the number of terms to use. |
||
def continued_fraction( first; next; count ): |
def continued_fraction( first; next; count ): |
||
# input: [i, a, b |
# input: [i, a, b] |
||
def cf: |
def cf: |
||
if .[0] == count then 0 |
if .[0] == count then 0 |