Exemplo n.º 1
0
 /**
  * Computes the product of a list of numbers
  * @return string
  */
 public function product()
 {
     Number::setScale(static::NUMERIC_FUNCTIONS_SCALE);
     $total = \strval($this->front());
     for ($i = 1, $l = $this->count(); $i < $l; ++$i) {
         $total = Number::multiply($total, \strval($this->_Arr[$i]));
     }
     return $total;
 }
Exemplo n.º 2
0
 public function testMultiply()
 {
     $l = '894659845843958';
     $r = '4756936453645';
     $exp = '4255840034307539960570326910';
     $this->assertEquals($exp, Number::multiply($l, $r));
 }