[LON-CAPA-cvs] cvs: modules /gerd evaluate.pl
www
lon-capa-cvs@mail.lon-capa.org
Fri, 31 Mar 2006 21:43:44 -0000
www Fri Mar 31 16:43:44 2006 EDT
Modified files:
/modules/gerd evaluate.pl
Log:
Rounding
Index: modules/gerd/evaluate.pl
diff -u modules/gerd/evaluate.pl:1.6 modules/gerd/evaluate.pl:1.7
--- modules/gerd/evaluate.pl:1.6 Fri Mar 31 11:43:09 2006
+++ modules/gerd/evaluate.pl Fri Mar 31 16:43:43 2006
@@ -280,7 +280,11 @@
unless ($threshold) { $threshold=0.29; }
my ($c,$n)=&correlation(&buildarrays($array1,$arrayidx1,$array2,$arrayidx2,$userkeys));
unless (abs($c)>$threshold) { return ('',''); }
- $c=int($c*100+0.5)/100;
+ if ($c>0) {
+ $c=int($c*100+0.5)/100;
+ } else {
+ $c=int($c*100-0.5)/100;
+ }
return " $label: $c ($n)";
}