cvs: pear /Math_Stats Stats.php

From: Date: Thu, 16 May 2002 04:45:28 +0000
Subject: cvs: pear /Math_Stats Stats.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-3850@lists.php.net to get a copy of this message
jmcastagnetto Thu May 16 00:45:28 2002 EDT Modified files: /pear/Math_Stats Stats.php Log: Another minor bug when dealing w/ nulls set to zero Index: pear/Math_Stats/Stats.php diff -u pear/Math_Stats/Stats.php:1.3 pear/Math_Stats/Stats.php:1.4 --- pear/Math_Stats/Stats.php:1.3 Thu May 16 00:27:10 2002 +++ pear/Math_Stats/Stats.php Thu May 16 00:45:28 2002 @@ -16,7 +16,7 @@ // | Authors: Jesus M. Castagnetto <jmcastagnetto@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Stats.php,v 1.3 2002/05/16 04:27:10 jmcastagnetto Exp $ +// $Id: Stats.php,v 1.4 2002/05/16 04:45:28 jmcastagnetto Exp $ // include_once "PEAR.php"; @@ -169,6 +169,8 @@ * @return mixed true on success, a PEAR_Error object otherwise */ function setData($arr, $opt=STATS_DATA_SIMPLE) {/*{{{*/ + $this->_data = null; + $this->_dataOption = null; if ($opt == STATS_DATA_SIMPLE) { $this->_dataOption = $opt; $this->_data = array_values($arr); @@ -754,8 +756,12 @@ unset($this->_data["$key"]); break; case STATS_USE_NULL_AS_ZERO: - unset($this->_data["$key"]); - $this->_data[0] += $v; + if ($flag) { + unset($this->_data["$key"]); + $this->_data[0] += $v; + } else { + $this->_data[$key] = 0; + } break; case STATS_REJECT_NULL : default:

« previous php.pear.cvs (#3850) next »