diff --git a/lib/Biodiverse/Matrix.pm b/lib/Biodiverse/Matrix.pm index 72e2b3574..9fca3f206 100644 --- a/lib/Biodiverse/Matrix.pm +++ b/lib/Biodiverse/Matrix.pm @@ -400,7 +400,8 @@ sub get_summary_stats { my %data; \my %top_level = $self->{BYELEMENT}; foreach my $href (values %top_level) { - $data{$_}++ for values %$href; + # round to save time and space - approximate vals should be OK for this + $data{0 + sprintf "%-6g", $_}++ for values %$href; } my %r; my $stats diff --git a/t/26-Cluster2.t b/t/26-Cluster2.t index c2b335fb6..bcfb47c7a 100644 --- a/t/26-Cluster2.t +++ b/t/26-Cluster2.t @@ -147,14 +147,14 @@ sub test_phylo_rw_turnover_mx { my $mx = $mx_arr->[0]; my %expected = ( - PCT975 => 0.8059701493, - PCT95 => 0.8059701493, + PCT975 => 0.80597, + PCT95 => 0.80597, MIN => 0, PCT025 => 0, PCT05 => 0, - MAX => 0.8059701493, - MEAN => 0.3751810522, - SD => 0.3047706206, + MAX => 0.80597, + MEAN => 0.3751808, + SD => 0.3047705823, ); my $stats = $mx->get_summary_stats; @@ -197,14 +197,14 @@ sub test_rw_turnover_mx { my $mx = $mx_arr->[0]; my %expected = ( - PCT975 => 0.8333333333, - PCT95 => 0.8333333333, + PCT975 => 0.833333, + PCT95 => 0.833333, MIN => 0, PCT025 => 0, PCT05 => 0, - MAX => 0.8333333333, - MEAN => 0.3923076923, - SD => 0.316227766, + MAX => 0.833333, + MEAN => 0.3923075333, + SD => 0.3162277347, ); my $stats = $mx->get_summary_stats;