Range calculation with Math.log : collect « Range « Ruby






Range calculation with Math.log


dividend = Math.log(2)
(1..6).collect { |x| Math.log(x) / dividend }
# => [0.0, 1.0, 1.58496250072116, 2.0, 2.32192809488736, 2.58496250072116]

 

Related examples in the same category