File: 07_statshash_more.t

package info (click to toggle)
libstatistics-lite-perl 3.62-1.1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 116 kB
  • sloc: perl: 288; makefile: 2
file content (15 lines) | stat: -rwxr-xr-x 432 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/perl
use strict;
use warnings;
use Test::More tests => 5;

BEGIN { use_ok( 'Statistics::Lite', ':all' ); }

# statshash: a tiny bit more substantial data set

my %stats = statshash(0..10,1);
is($stats{sum},56,"call sum - hash-based");
is($stats{mean},4+2/3,"call mean - hash-based");
is($stats{variance},11+1/3,"call variance - hash-based");
is($stats{variancep},10.3+8/90,"call variancep - hash-based");