projects
/
liboping.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
b432731
)
Correct the calculation of the standard deviation.
author
octo
<octo>
Tue, 16 May 2006 19:10:46 +0000
(19:10 +0000)
committer
octo
<octo>
Tue, 16 May 2006 19:10:46 +0000
(19:10 +0000)
src/oping.c
patch
|
blob
|
history
diff --git
a/src/oping.c
b/src/oping.c
index
37f64b2
..
5940001
100644
(file)
--- a/
src/oping.c
+++ b/
src/oping.c
@@
-401,7
+401,8
@@
int main (int argc, char **argv)
num_total = (double) context->req_rcvd;
average = context->latency_total / num_total;
num_total = (double) context->req_rcvd;
average = context->latency_total / num_total;
- deviation = sqrt (context->latency_total_square - (num_total * average * average));
+ deviation = sqrt (((num_total * context->latency_total_square) - (context->latency_total * context->latency_total))
+ / (num_total * (num_total - 1.0)));
printf ("rtt min/avg/max/sdev = %.3f/%.3f/%.3f/%.3f ms\n",
context->latency_min,
printf ("rtt min/avg/max/sdev = %.3f/%.3f/%.3f/%.3f ms\n",
context->latency_min,