Skip Menu |

This queue is for tickets about the Statistics-Descriptive-Discrete CPAN distribution.

Report information
The Basics
Id: 65545
Status: new
Priority: 0/
Queue: Statistics-Descriptive-Discrete

People
Owner: Nobody in particular
Requestors: rmesser [...] intellisurvey.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 0.02
  • 0.03
  • 0.07
Fixed in: (no value)



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?