@param \Keios\MoneyRight\Money $subtrahend

@return \Keios\MoneyRight\Money
@throws \Keios\MoneyRight\Exceptions\InvalidArgumentException
169862
public function subtract(Money $subtrahend)
    {
        $this->assertSameCurrency($subtrahend);

        return new Money(bcsub($this->amount, $subtrahend->getAmountString(), self::GAAP_PRECISION), $this->currency);
    }
1224415
public function reduce(BankInterface $bank = null, $toCurrency = null)
    {
        if (null === $bank) {
            $bank = static::getBank();
        }

        if (!$bank instanceof MultiCurrencyBankInterface) {
            throw new \InvalidArgumentException('The supplied bank must implement MultiCurrencyBankInterface');
        }

        $rounder = $bank->getRounder();
        $amount = bcadd(
            $this->getAugend()->reduce($bank, $toCurrency)->getAmount(),
            $this->getAddend()->reduce($bank, $toCurrency)->getAmount(),
            $rounder->getPrecision() + 1
        );

        $amount = $rounder->round($amount, $toCurrency);

        return $bank->createMoney($amount, $toCurrency);
    }
850100
public function sub(...$numbers)
    {
        foreach ($numbers as $number) {
            $this->number = bcsub($this->number, static::validateInputNumber($number), $this->precision);
        }

        return $this;
    }
585422
public function setFee(Money $money): ShippingMethodInterface
    {
        $this->feeAmount = $money->getAmount();
        $this->feeCurrency = $money->getCurrency()->getCode();

        return $this;
    }
1296261
@Override
    public Money subtract(MonetaryAmount subtrahend) {
        MoneyUtils.checkAmountParameter(subtrahend, this.currency);
        if (subtrahend.isZero()) {
            return this;
        }
        return new Money(this.number.subtract(subtrahend.getNumber().numberValue(BigDecimal.class)), getCurrency());
    }
955166
public function negate(MoneyInterface $money)
    {
        if ($this->isZero($money)) {
            return $money;
        } else {
            return $this->mul($money, '-1');
        }
    }
1159986
public function minus($number)
    {
        self::mustBeNumeric($number, 'Value to substract');
        
        $number = is_object($number) ? $number->value : $number;
        
        return new self($this->value - $number);
    }
333250
public BigDecimal subtract(BigDecimal subtrahend) {
        if (this.intCompact != INFLATED) {
            if ((subtrahend.intCompact != INFLATED)) {
                return add(this.intCompact, this.scale, -subtrahend.intCompact, subtrahend.scale);
            } else {
                return add(this.intCompact, this.scale, subtrahend.intVal.negate(), subtrahend.scale);
            }
        } else {
            if ((subtrahend.intCompact != INFLATED)) {
                // Pair of subtrahend values given before pair of
                // values from this BigDecimal to avoid need for
                // method overloading on the specialized add method
                return add(-subtrahend.intCompact, subtrahend.scale, this.intVal, this.scale);
            } else {
                return add(this.intVal, this.scale, subtrahend.intVal.negate(), subtrahend.scale);
            }
        }
    }
517226
private function newWrappedMoneyFromMoney(MoneyInterface $money)
    {
        return new WrappedMoney(
            $money->getAmount(),
            new WrappedCurrency(
                $money
                    ->getCurrency()
                    ->getIso()
            )
        );
    }
280044
public function subtract(Money $other)
    {
        $other = $other->convertToCurrency($this->currency);
        $this->assertSameCurrency($this, $other);

        $value = $this->amount - $other->getAmount();

        $this->assertIsFloat($value);

        return $this->newMoney($value);
    }
443579
public function extract($value)
    {
        if (!$value instanceof Money) {
            throw new \InvalidArgumentException(sprintf(
                '$value expected type SCL\Currency\Money, got "%s"',
                is_object($value) ? get_class($value) : gettype($value)
            ));
        }

        return $value->getValue();
    }
305526
public function add(MoneyInterface $other)
    {
        $wrappedMoney = $this
            ->wrappedMoney
            ->add($this->newWrappedMoneyFromMoney($other));

        return self::create(
            $wrappedMoney->getAmount(),
            $other->getCurrency()
        );
    }
668040
public function PaymentOrderCancel($paymentOrderId, $amount, $currency)
    {
        $request = new Request();
        $request->setMethod('POST');

        foreach (array('paymentOrderId', 'amount', 'currency') as $param) {
            if (null == $$param) {
                throw new InvalidArgumentException($param);
            }
        }

        $params = array(
            'PaymentOrderId' => $paymentOrderId,
            'CancelAmount'   => $amount,
            'Currency'       => $currency
        );

        $request->setContent(json_encode($params));

        return $this->doRequest('PaymentOrder/Cancel', $request)->getContentJson();
    }
508101
public function add(Money $money) : Money
    {
        $this->verifySameCurrency(__METHOD__, $money);

        return new Money($this->amount + $money->amount, $this->currency);
    }
1145871
public function round(MoneyInterface $money, $precision = null, $mode = PHP_ROUND_HALF_UP)
    {
        if ($precision === null) {
            $precision = $this->informationProvider->getDefaultPrecision($money->getCurrency());
        }
        return $this->factory->create(
            $this->math->round($money->getAmount(), $precision, $mode),
            $money->getCurrency()
        );
    }
423261
public function setPaymentMethodFee(Money $money = null): OrderInterface
    {
        $this->paymentMethodFee = $money->getAmount();

        return $this;
    }
664724
public function toSubunits($roundingMode = self::ROUND_HALF_UP)
    {
        $this->assertRoundingMode($roundingMode);

        $precision = $this->getPrecision();
        if (null === $roundingMode) {
            $amount = $this->amount->round($precision);
        } else {
            $amount = Math::bcround($this->amount, $precision, $roundingMode);
        }

        $subunitToUnit = $this->currency->getSubunitToUnit();
        if ($subunitToUnit > 1) {
            $subunitToUnit = Decimal::create($subunitToUnit, $precision);
            $amount = $amount->mul($subunitToUnit, $precision);
        }

        return $amount->asInteger();
    }