summaryrefslogtreecommitdiffstats
path: root/cddl
diff options
context:
space:
mode:
authormarkj <markj@FreeBSD.org>2015-04-12 21:35:13 +0000
committermarkj <markj@FreeBSD.org>2015-04-12 21:35:13 +0000
commit6a076d8809e779df6f22552edc05e74ae89eac66 (patch)
tree1f3911f4521d631bfe1f6a4d66786529a5dbac47 /cddl
parent6c5bc954a56b6fa4d733aab7da7e4e48134a355c (diff)
downloadFreeBSD-src-6a076d8809e779df6f22552edc05e74ae89eac66.zip
FreeBSD-src-6a076d8809e779df6f22552edc05e74ae89eac66.tar.gz
MFC r278114:
libdtrace: Let the standard deviation of the empty set be 0. PR: 197260
Diffstat (limited to 'cddl')
-rw-r--r--cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c
index 072cb05..ec5839a 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c
@@ -382,6 +382,9 @@ dt_stddev(uint64_t *data, uint64_t normal)
int64_t norm_avg;
uint64_t diff[2];
+ if (data[0] == 0)
+ return (0);
+
/*
* The standard approximation for standard deviation is
* sqrt(average(x**2) - average(x)**2), i.e. the square root
OpenPOWER on IntegriCloud