Subject: | Error in get_data() when min value is 0 |
Date: | Tue, 11 Mar 2014 16:24:21 -0600 |
To: | bug-Statistics-Descriptive-Weighted [...] rt.cpan.org |
From: | Jason Hall <jayce [...] lug-nut.com> |
in version 0.6 if you add_data where the value is 0 (and no negative values
exist), get_data will break.
The problem is in the get_data method, line 401:
while ($key){
works with:
while (defined $key){
fixing this case:
DB<39> $stat = Statistics::Descriptive::Weighted::Full->new();
DB<40> $stat->add_data([1,0,3,40],[0.1,1,10,100]);
DB<41> x $stat->get_data
0 HASH(0x7fc5038db578)
'cdfs' => ARRAY(0x7fc503891658)
empty array
'counts' => ARRAY(0x7fc504a3dd80)
empty array
'order' => ARRAY(0x7fc5058b2748)
empty array
'percentiles' => ARRAY(0x7fc504a3e218)
empty array
'rtps' => ARRAY(0x7fc5058b2310)
empty array
'sumweights' => ARRAY(0x7fc5038db2c0)
empty array
'uniqvars' => ARRAY(0x7fc5058924e8)
empty array
'vars' => ARRAY(0x7fc503837168)
empty array
'weights' => ARRAY(0x7fc5038db248)
empty array
--
Jayce^
Preparing Deseret - UtahPreppers
ΜΟΛΩΝ ΛΑΒΕ