Subtract a given fraction from this fraction

@author Tom Haskins-Vaughan <tom@tomhv.uk>
@since  0.1.0

@param Fraction $fraction

@return Fraction
167116
public function subtract(Fraction $fraction)
    {
        $numerator = ($this->getNumerator() * $fraction->getDenominator())
            - ($fraction->getNumerator() * $this->getDenominator());

        $denominator = $this->getDenominator()
            * $fraction->getDenominator();

        return new static($numerator, $denominator);
    }
628760
public static function subtractSecond($ts = null, $num = 1)
	{
		return sfTime::subtract($ts, $num, sfTime::SECOND);
	}
928382
function Fraction(a, b) {

    if (!(this instanceof Fraction)) {
      return new Fraction(a, b);
    }

    parse(a, b);

    if (Fraction['REDUCE']) {
      a = gcd(P["d"], P["n"]); // Abuse a
    } else {
      a = 1;
    }

    this["s"] = P["s"];
    this["n"] = P["n"] / a;
    this["d"] = P["d"] / a;
  }
169862
public function subtract(Money $subtrahend)
    {
        $this->assertSameCurrency($subtrahend);

        return new Money(bcsub($this->amount, $subtrahend->getAmountString(), self::GAAP_PRECISION), $this->currency);
    }
795191
public function subtract(Money $money) : Money
    {
        $this->verifySameCurrency(__METHOD__, $money);

        return $this->add($money->negate());
    }
1215094
public function subtract(Money $money)
    {
        $diff = new Money($this->getAmount() - $money->getAmount());
        $this->setWhole($diff->getAmount());
        $this->setFraction($diff->getAmount());
        return $this;
    }
1110513
public static function subtractMinute($ts = null, $num = 1)
	{
		return sfTime::subtract($ts, $num, sfTime::MINUTE);
	}
1223816
public function subtract(
        Fiat\Money $money1,
        Fiat\Money $money2
    ): Fiat\Money {
        return $this->accountant->subtract($money1, $money2);
    }
409499
public function subtract($amount, $subtrahend)
    {
        return (string) Number::fromString(bcsub($amount, $subtrahend, $this->scale));
    }
817204
public function subtract($interval) : self
    {
        $instance = clone $this;
        
        $instance->date->sub(self::resolveDateInterval($interval));
        
        return $instance;
    }
1360608
public function divide($factor)
    {
        if (!is_numeric($factor)) {
            throw new \InvalidArgumentException('Factor must be numeric');
        }

        $amount = bcdiv($this->amount, strval($factor), self::BCSCALE);

        return self::valueOf($amount, $this->currency);
    }
574407
public static function subtractQuarter($ts = null, $num = 1)
	{
		return sfTime::subtract($ts, $num, sfTime::QUARTER);
	}
189118
public function darken($fraction=0.1)
    {
        $hsl = $this->toHSL();
        $l = $hsl[2];
        // so that 100% darker = black
        $dl = -$l * $fraction;

        return $this->changeHSL(0, 0, $dl);
    }
637212
public function subtotal($decimals = null, $decimalPoint = null, $thousandSeperator = null)
    {
        return $this->numberFormat($this->subtotal, $decimals, $decimalPoint, $thousandSeperator);
    }
886662
public function subtract(MoneyContainer $money) : MoneyBag
    {
        foreach ($money->getAmounts() as $currencyCode => $amount) {
            $this->amounts[$currencyCode] = $this->getAmount($currencyCode)->minus($amount);
        }

        return $this;
    }
1289268
protected function icon_for_fraction($fraction) {
        global $OUTPUT;

        $feedbackclass = question_state::graded_state_for_fraction($fraction)->get_feedback_class();
        return $OUTPUT->pix_icon('i/grade_' . $feedbackclass, get_string($feedbackclass, 'question'),
                'moodle', array('class' => 'icon'));
    }
363085
public function toCurrencyWords($currency, $decimal, $fraction = null)
    {
        $currency = strtoupper($currency);

        if (!array_key_exists($currency, static::$currencyNames)) {
            throw new NumberToWordsException(
                sprintf('Currency "%s" is not available for "%s" language', $currency, get_class($this))
            );
        }

        $currencyNames = static::$currencyNames[$currency];

        $level = ($decimal == 1) ? 0 : 1;

        if ($level > 0) {
            $currencyNames = self::$currencyNames[$currency];
            if (count($currencyNames[0]) > 1) {
                $ret = $currencyNames[0][$level];
            } else {
                $ret = $currencyNames[0][0] . 's';
            }
        } else {
            $ret = $currencyNames[0][0];
        }

        $ret = $this->wordSeparator . trim($this->toWords($decimal) . ' ' . $ret);

        if (null !== $fraction) {
            $ret .= $this->wordSeparator . 'con' . $this->wordSeparator . trim($this->toWords($fraction));

            $level = ($fraction == 1) ? 0 : 1;

            if ($level > 0) {
                if (count($currencyNames[1]) > 1) {
                    $ret .= $this->wordSeparator . $currencyNames[1][$level];
                } else {
                    $ret .= $this->wordSeparator . $currencyNames[1][0] . 's';
                }
            } else {
                $ret .= $this->wordSeparator . $currencyNames[1][0];
            }
        }

        return $ret;
    }