sub rms(*@nums) { sqrt ([+] @nums X** 2) / @nums } say rms 1..10;
Here's a slightly more concise version, albeit arguably less readable:
sub rms { sqrt @_ R/ [+] @_ X** 2 }
Last updated 1 year ago