Skip Menu |

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

Report information
The Basics
Id: 72495
Status: resolved
Priority: 0/
Queue: Statistics-Descriptive

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

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: calling percentiles when there is no data shouldn't die
Currently if you do this: my $stat = Statistics::Descriptive::Full->new(); my $x = $stat->percentile(100); the module dies, throwing a division by zero error. I think it would be more consistent and better for callers if the percentile method simply returned undef in this case, like it does in other situations where it doesn't have enough data to calculate a particular percentile.
Hi Robert, On Thu Nov 17 11:39:52 2011, rmesser wrote: Show quoted text
> Currently if you do this: > > my $stat = Statistics::Descriptive::Full->new(); > my $x = $stat->percentile(100); > > the module dies, throwing a division by zero error. > > I think it would be more consistent and better for callers if the > percentile method simply returned undef in this case, like it does in > other situations where it doesn't have enough data to calculate a > particular percentile.
thanks for the report. Seems logical. I'll take a look. Regards, -- Shlomi Fish
Fixed in 3.0203 (With a regression test). Thanks for the report.