Jump to content

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`)
m (→‎{{header|Perl 6}}: for want of a Q the quote was lost)
Line 1,285:
 
=={{header|Perl 6}}==
{{worksWorks with|rakudo|2015-0912-3019}}
{{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>
2,392

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.