Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269017
b: refs/heads/master
c: 19f4740
h: refs/heads/master
i:
  269015: ec72603
v: v3
  • Loading branch information
Jim Cromie authored and Arnaldo Carvalho de Melo committed Sep 29, 2011
1 parent 9dd545d commit e06773e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 56f3bae70638b33477a6015fd362ccfe354fd3ee
refs/heads/master: 19f4740255668ca297dcf9f02d80eb9bc87a1d66
9 changes: 7 additions & 2 deletions trunk/tools/perf/builtin-stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,13 @@ static double avg_stats(struct stats *stats)
*/
static double stddev_stats(struct stats *stats)
{
double variance = stats->M2 / (stats->n - 1);
double variance_mean = variance / stats->n;
double variance, variance_mean;

if (!stats->n)
return 0.0;

variance = stats->M2 / (stats->n - 1);
variance_mean = variance / stats->n;

return sqrt(variance_mean);
}
Expand Down

0 comments on commit e06773e

Please sign in to comment.