diff options
-rwxr-xr-x | stddev | 2 | ||||
-rwxr-xr-x | var | 2 |
2 files changed, 3 insertions, 1 deletions
@@ -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] @@ -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 |