summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2014-03-07 17:52:25 +0100
committerPatrick Simianer <p@simianer.de>2014-03-07 17:52:25 +0100
commite7281b5c337f9684dc40c809262afc9359b0c771 (patch)
treead3693a8ab09fbadf300ce5db7f13555c8b5005d
parent133533638df8f748eb2982c1a762adb013d2ae4e (diff)
fix
-rwxr-xr-xstddev2
-rwxr-xr-xvar2
2 files changed, 3 insertions, 1 deletions
diff --git a/stddev b/stddev
index 891c4c9..5cda0e0 100755
--- a/stddev
+++ b/stddev
@@ -25,7 +25,7 @@ cached.each { |v|
var += (avg - v)**2
}
-stddev = Math.sqrt(var)
+stddev = Math.sqrt(var/i.to_f)
if cfg[:round] >= 0
puts stddev.round cfg[:round]
diff --git a/var b/var
index 30c638a..fe4aa22 100755
--- a/var
+++ b/var
@@ -26,6 +26,8 @@ cached.each { |v|
var += (avg - v)**2
}
+var /= i.to_f
+
if cfg[:round] >= 0
puts var.round cfg[:round]
else