diff options
author | markj <markj@FreeBSD.org> | 2015-04-12 21:35:13 +0000 |
---|---|---|
committer | markj <markj@FreeBSD.org> | 2015-04-12 21:35:13 +0000 |
commit | 6a076d8809e779df6f22552edc05e74ae89eac66 (patch) | |
tree | 1f3911f4521d631bfe1f6a4d66786529a5dbac47 /cddl/contrib/opensolaris/lib/libdtrace | |
parent | 6c5bc954a56b6fa4d733aab7da7e4e48134a355c (diff) | |
download | FreeBSD-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/contrib/opensolaris/lib/libdtrace')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c | 3 |
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 |