Continued fraction/Arithmetic/G(matrix ng, continued fraction n1, continued fraction n2): Difference between revisions
Content added Content deleted
Line 2,973: | Line 2,973: | ||
procedure cf2string (cf, max_terms) |
procedure cf2string (cf, max_terms) |
||
local s, i, done, term |
local s, i, done, term |
||
static separators |
|||
local sep_str |
|||
initial { |
|||
separators := ["", ";", ","] |
|||
} |
|||
/max_terms := 20 |
/max_terms := 20 |
||
Line 2,988: | Line 2,992: | ||
done := YES |
done := YES |
||
} else { |
} else { |
||
s ||:= |
s ||:= separators[min (i + 1, 3)] || term |
||
i +:= 1 |
i +:= 1 |
||
} |
} |
||
Line 3,097: | Line 3,101: | ||
if /cf then { |
if /cf then { |
||
# Generate " |
# Generate only "infinite" terms. |
||
source := create generate_constant (&null) |
source := create generate_constant (&null) |
||
} else if type(cf) == "co-expression" then { |
} else if type(cf) == "co-expression" then { |