Example #1
0
 public function subtract($num)
 {
     $num = Numbers::makeOrDont($this, $num, $this->getPrecision());
     $oldBase = $this->convertForModification();
     $numOldBase = $num->convertForModification();
     $value = BCProvider::subtract($this->getValue(), $num->getValue());
     $this->convertFromModification($oldBase);
     $num->convertFromModification($numOldBase);
     return $this->setValue($value);
 }
Example #2
0
 public function PDFByValue($value)
 {
     $value = Numbers::makeOrDont($this->numberType, $value);
     return Numbers::make($this->numberType, BCProvider::multiply(BCProvider::divide(1, BCProvider::multiply($this->standardDev->getValue(), BCProvider::squareRoot(M_2_PI))), BCProvider::exp(M_E, BCProvider::multiply(-1, BCProvider::divide(BCProvider::exp(BCProvider::subtract($value->getValue(), $this->mean->getValue()), 2), BCProvider::multiply(2, $this->variance->getValue()))))), $value->getPrecision(), $value->getBase());
 }