facets icon indicating copy to clipboard operation
facets copied to clipboard

Fix Math.gini_coefficient(array)

Open TheStranjer opened this issue 2 years ago • 0 comments

Currently if you try this code:

require 'facets/math/gini_coefficient'
a = (1..10).to_a
Math::gini_coefficient(a)

It will throw this error:

lib/standard/facets/math/gini_coefficient.rb:16:in `gini_coefficient': undefined local variable or method `size' for Math:Module (NameError)

At first I thought I might be using it wrong, but all the other array-based methods in facets/math seem to refer to the array directly, so this should too.

TheStranjer avatar Mar 22 '22 20:03 TheStranjer