Closed pcarvsilva closed 2 years ago
I clicked the wrong button when I wanted to reply with a comment; apologies.
Also, sorry for the very long wait before my response.
@pcarvsilva do you still want to pursue this? Histogram functionality is within the scope of the library. However, I have two questions:
** (CompileError) test/math/enum_test.exs:23: undefined function min/1 (expected Math.EnumTest to define such a function or for it to be imported, but none are available)
It is not entirely clear to me how this error should be fixed.
histogram
function:
Math.Enum.histogram(enumerable, 0)
results in an ArithmeticError. It would be better to raise an ArgumentError that hints at the caller mis-using the function.Math.Enum.histogram([1,2,3,1,2,3], 100)
do not result in 100 buckets (with most of them having 0
as value), but only with three buckets.Math.Enum.histogram([1,2,3,1,2,3], 1)
results in 2 buckets, and Math.Enum.histogram([1,2,3,1,2,3], 2)
results in 3 buckets.
Adding Histogram functions, probably helpful for livebook stuff