Skip Menu |

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

Report information
The Basics
Id: 62313
Status: rejected
Worked: 1 min
Priority: 0/
Queue: Statistics-Basic

People
Owner: Nobody in particular
Requestors: jiri [...] eimb.ru
Cc:
AdminCc:

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



Subject: Statistics-Basic-1.6602
Date: Wed, 20 Oct 2010 17:50:14 +0400
To: bug-Statistics-Basic [...] rt.cpan.org
From: "Youri V. Kravatsky" <jiri [...] eimb.ru>
Hello, bug collector! Module: Statistics-Basic-1.6602 This is perl, v5.10.1 built for MSWin32-x86-multi-thread (with 2 registered patches, see perl -V for more detail) Copyright 1987-2009, Larry Wall Binary build 1006 [291086] provided by ActiveState http://www.ActiveState.com Built Aug 24 2009 13:48:26 Operating system: Windows XP SP3 At least stddev() and variance () functions are working erroneously. Example (just from manual to module): use Statistics::Basic qw(:all nofill); @arr=[1,2,3]; my $median = median( @arr); my $mean = mean( @arr); my $variance = variance(@arr); my $stddev = stddev(@arr); print "deviance=$stddev, median=$median, variance=$variance, mean=$mean\n"; The output will be: deviance=0.82, median=2, variance=0.67, mean=2 What is wrong: deviance=1.0, variance=1.0 Sincerely yours, Youri ---------------------------------------------------------------------- Internet: jiri@eimb.ru | FAX: +7-095-135-1405 jiri@imb.ac.ru | ICQ: 1870550 WWW: http://www.lebedev.ru/jiri | Mobile: Motorola ROKR E1 :)
On Wed Oct 20 09:50:32 2010, jiri@eimb.ru wrote: Show quoted text
> @arr=[1,2,3];
You're building @arr is a single element array with a string in it (kindof). You wanted @arr = (1,2,3); This is clearest to see like so: print "@arr\n"; ... this should print "1 2 3" and yours will print "ARRAY(0xa235450)" or something similar to that. See also: http://perldoc.perl.org/perldata.html http://perldoc.perl.org/perlreftut.html -- If riding in an airplane is flying, then riding in a boat is swimming. 116 jumps, 48.6 minutes of freefall, 92.9 freefall miles.