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
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to