Ruby - Adding array indexes of one arryay with other one
Posted: Wed Mar 03, 2021 11:24 pm
Hi,
Wondered if there is any elegant Ruby shortcut to add float array indexes with other float array indexes while keeping their correct order.
For example, let's say we have this array:
1.5
2
3.3
6.4
And we want to add it this array:
1.5
2.3
1
2.4
To get this results at the output:
3
4.3
4.3
8.8
Possible?
Wondered if there is any elegant Ruby shortcut to add float array indexes with other float array indexes while keeping their correct order.
For example, let's say we have this array:
1.5
2
3.3
6.4
And we want to add it this array:
1.5
2.3
1
2.4
To get this results at the output:
3
4.3
4.3
8.8
Possible?