Skip to main content

Timeline for Calculate power series result

Current License: CC BY-SA 4.0

5 events
when toggle format what by license comment
Aug 1, 2018 at 12:33 comment added AdmBorkBork @mazzy Thanks! There's no need to re-initialize $s if it's run as a full program (e.g., how it's done on Try It Online), so that saves a few more bytes.
Aug 1, 2018 at 12:32 history edited AdmBorkBork CC BY-SA 4.0
-7 bytes thanks to mazzy
Aug 1, 2018 at 10:16 comment added mazzy 2 bytes less: param($x,$n,$s)0..$n|%{$s+=[math]::pow($x,$_)};$s. A caller still sends 2 parameters.
Aug 1, 2018 at 9:20 comment added mazzy It's stupid, but this param($x,$n)$s=0;0..$n|%{$s+=[math]::pow($x,$_)};$s is shorter. I don't sure about $s=0;: this expression is needed on a second run. Perhaps, it better to append ;rv s to the end.
Jul 30, 2018 at 20:27 history answered AdmBorkBork CC BY-SA 4.0