array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.stats-variance.php', 1 => 'stats_variance', 2 => 'Returns the variance', ), 'up' => array ( 0 => 'ref.stats.php', 1 => 'Statistic 函数', ), 'prev' => array ( 0 => 'function.stats-stat-powersum.php', 1 => 'stats_stat_powersum', ), 'next' => array ( 0 => 'book.trader.php', 1 => 'Trader', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/stats/functions/stats-variance.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

stats_variance

(PECL stats >= 1.0.0)

stats_varianceReturns the variance

说明

stats_variance(array $a, bool $sample = false): float

Returns the variance of the values in a.

参数

a

The array of data to find the standard deviation for. Note that all values of the array will be cast to float.

sample

Indicates if a represents a sample of the population; defaults to false.

返回值

Returns the variance on success; false on failure.