Formal power series: Difference between revisions

m
→‎{{header|Perl 6}}: Set the topic directly in the for loop.
m (→‎{{header|Perl 6}}: got rid of unneeded returns)
m (→‎{{header|Perl 6}}: Set the topic directly in the for loop.)
Line 1,109:
sub super($i) { $i.trans('0123456789' => '⁰¹²³⁴⁵⁶⁷⁸⁹') }
my $str = $.coeffs[0].perl;
for 1..$n Z $.coeffs[1..$n] -> $i, $c_ {
givenwhen * > 0 { $cstr ~= " + {(+$_).perl}∙x{super($i)}" }
when * >< 0 { $str ~= " +- {(+-$c_).perl}∙x{super($i)}" }
when * < 0 { $str ~= " - {(-$c).perl}∙x{super($i)}" }
}
}
$str;
57

edits