You are viewing a single comment's thread. Return to all comments →
A more readable way.
arr_size = arr.size [:positive?, :negative?, :zero?].each do |action| p arr.count(&action).to_f/arr_size end
Seems like cookies are disabled on this browser, please enable them to open this website
Plus Minus
You are viewing a single comment's thread. Return to all comments →
A more readable way.