put @e.map( * / @e.min );
OR
put @e.map: * / @e.min;
Sample Input:
my @e = <60.922 20.946 8.721 7.292 4.306 2.821 2.765 2.752 2.741 2.725>;
Sample Output:
22.356697 7.686606 3.200367 2.675963 1.580183 1.035229 1.014679 1.009908 1.005872 1
If you want to continue working with the resultant values, assign the output to a new variable. Or overwrite the original @e
array using the .=
"back-assignment" operator [ short for @e = @e.map( … )
]. In the Raku REPL:
~$ raku
Welcome to ™ v2021.06.
Implementing the ™ programming language v6.d.
Built on MoarVM version 2021.06.
To exit type 'exit' or '^D'
> my @e = <60.922 20.946 8.721 7.292 4.306 2.821 2.765 2.752 2.741 2.725>;
[60.922 20.946 8.721 7.292 4.306 2.821 2.765 2.752 2.741 2.725]
> @e .= map( * / @e.min );
[22.356697 7.686606 3.200367 2.675963 1.580183 1.035229 1.014679 1.009908 1.005872 1]
> put @e;
22.356697 7.686606 3.200367 2.675963 1.580183 1.035229 1.014679 1.009908 1.005872 1
>