Date: Sun, 12 Apr 2015 21:35:13 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281472 - stable/10/cddl/contrib/opensolaris/lib/libdtrace/common Message-ID: <201504122135.t3CLZDD3028661@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Sun Apr 12 21:35:13 2015 New Revision: 281472 URL: https://svnweb.freebsd.org/changeset/base/281472 Log: MFC r278114: libdtrace: Let the standard deviation of the empty set be 0. PR: 197260 Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Sun Apr 12 21:28:54 2015 (r281471) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Sun Apr 12 21:35:13 2015 (r281472) @@ -382,6 +382,9 @@ dt_stddev(uint64_t *data, uint64_t norma 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504122135.t3CLZDD3028661>