Polynomial long division: Difference between revisions
m
→{{header|Perl 6}}: for want of a Q the quote was lost
m (→{{header|Sidef}}: replaced `.each_with_index` with `.each_kv`) |
SqrtNegInf (talk | contribs) m (→{{header|Perl 6}}: for want of a Q the quote was lost) |
||
Line 1,285:
=={{header|Perl 6}}==
{{
{{trans|Perl}} for the core algorithm; original code for LaTeX pretty-printing.
<lang perl6>sub poly_long_div ( @n is copy, @d ) {
Line 1,308:
say '<math>\begin{array}{rr}';
for @polys -> [ @a, @b ] {
printf Q"%s , & %s \\\\\n", poly_long_div( @a, @b ).map: { poly_print($_) };
}
say '\end{array}</math>';</lang>
|