[ruby-core:116236] [Ruby master Feature#18057] Introduce Array#mean

16 Jan
2024
16 Jan
'24
2:10 p.m.
Issue #18057 has been updated by matheusrich (Matheus Richard). Was this proposal rejected? ---------------------------------------- Feature #18057: Introduce Array#mean https://bugs.ruby-lang.org/issues/18057#change-106257 * Author: ggmichaelgo (Michael Go) * Status: Open * Priority: Normal ---------------------------------------- Introduce Array#average to calculate the average value of an array. ```ruby array = [1, 2, 3] array.mean # 2 array = [1.5, 2.2, 3.1] array.mean(&:round) # 2.3333333333333335 array = [-3, -2, -1] array.mean { |e| e.abs } # 2 ``` -- https://bugs.ruby-lang.org/
566
Age (days ago)
566
Last active (days ago)
0 comments
1 participants
participants (1)
-
matheusrich (Matheus Richard)