private function floorModulo(Decimal $x, Decimal $y) : Decimal { return $x->sub($y->mul($x->div($y)->floor())); }
/** * 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); }