You are viewing a single comment's thread. Return to all comments →
Nice! Heads up for the methodfdiv. It's little-known but very useful.
fdiv
puts arr.count {|n| n > 0}.fdiv(n) puts arr.count {|n| n < 0}.fdiv(n) puts arr.count {|n| n == 0}.fdiv(n)
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 →
Nice! Heads up for the method
fdiv
. It's little-known but very useful.