brycebaril / node-stats-lite

A light statistical package that operates on Arrays.
MIT License
74 stars 11 forks source link

Mean should return undefined when array is empty #12

Open Odonno opened 5 years ago

Odonno commented 5 years ago

Indead, I suppose that when mean is used with an empty array, it divides by 0 and so it returns NaN. I think it would be more appropriate to return undefined when we cannot execute the calculation.