Subject: | running stats with no data causes division by zero error |
Right now if you create a new object like this:
my $s = Statistics::Descriptive::Discrete->new();
then run stats without providing data:
my $mean = $s->mean();
you'll get a "division by zero" error. Really the module should return
undef or just 0, like the Statistics::Descriptive module does.
Otherwise anyone using this module has to do their own "no data" checks
and/or wrap calls in an eval. It would be better if this module did the
check, a simple one-liner change to the _all_stats -- just a "return if
$count==0" somewhere near the top would work.
But is anyone still maintaining this module?