/** * * @return null, \qtism\common\datatypes\Float */ protected function processPopVariance() { $operands = $this->getOperands(); $operand = $operands[0]; $result = OperatorsUtils::variance(self::filterValues($operand->getArrayCopy()), false); return $result !== false ? new QtiFloat(floatval($result)) : null; }
/** * @dataProvider varianceProvider * * @param array $sample * @param boolean Apply Bessel's correction? * @param number $expected */ public function testVariance(array $sample, $correction, $expected) { $result = OperatorsUtils::variance($sample, $correction); $this->assertSame($expected, $result); }