File: 04_functional_unbiased.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 521 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 => 6;

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

# unbiased sample test

my @values = (3, -10, 8, undef, 7, undef, 8, 3, 6, 3);
is(mean(@values), 3.5, "call unbiased sample set mean" );
is(median(@values), 4.5, "call unbiased sample set median" );
is(mode(@values), 3, "call unbiased sample set mode" );
is(variance(1,2,3), 1, "call unbiased sample set variance");
is(stddev(1,2,3),   1, "call unbiased sample set standard deviation");