sub() публичный Метод

Subtracts two BigNumber objects
public sub ( Decimal $b, integer $scale = null ) : Decimal
$b Decimal
$scale integer
Результат Decimal
Пример #1
0
 private function floorModulo(Decimal $x, Decimal $y) : Decimal
 {
     return $x->sub($y->mul($x->div($y)->floor()));
 }
Пример #2
0
 /**
  * Returns a new Money object that represents
  * the difference of this and an other Money object
  *
  * @param Money $money
  * @return Money
  */
 public function subtract(Money $money)
 {
     $this->assertSameCurrency($money);
     $amount = $this->amount->sub($money->amount, $this->getInnerPrecision());
     return $this->newInstance($amount);
 }