Amitleshed (Amit Leshed)
- Login: Amitleshed
- Registered on: 07/23/2025
- Last sign in: 08/25/2025
Issues
| open | closed | Total | |
|---|---|---|---|
| Assigned issues | 0 | 0 | 0 |
| Reported issues | 1 | 0 | 1 |
Activity
07/25/2025
-
07:07 PM Ruby Feature #21518: Statistical helpers to `Enumerable`
- ***
Thanks for the engagement everyone
***
Here's a refactored version:
``` ruby
module Enumerable
def average
return nil if none?
return range_midpoint if numeric_range?
total = 0.0
count = 0
each ...
07/24/2025
-
02:35 PM Ruby Feature #21518: Statistical helpers to `Enumerable`
- Thanks, great catch!
07/23/2025
-
03:30 PM Ruby Feature #21518 (Open): Statistical helpers to `Enumerable`
- **Summary**
I'd like to add two statistical helpers to `Enumerable`:
- `Enumerable#average` (arithmetic mean)
- `Enumerable#median`
Both are small, well-defined operations that many Rubyists re-implement in apps and gems. Provi...