Multiply this fraction by a given fraction

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

@param Fraction $fraction

@return Fraction
355858
public function multiply(Fraction $fraction)
    {
        $numerator = $this->getNumerator() * $fraction->getNumerator();
        $denominator = $this->getDenominator() * $fraction->getDenominator();

        return new static($numerator, $denominator);
    }
80168
@Override
    public Money multiply(Number multiplicand) {
    	NumberVerifier.checkNoInfinityOrNaN(multiplicand);
        BigDecimal multiplicandBD = MoneyUtils.getBigDecimal(multiplicand);
        if (multiplicandBD.equals(BigDecimal.ONE)) {
            return this;
        }
        MathContext mc = MoneyUtils.getMathContext(monetaryContext, RoundingMode.HALF_EVEN);
        BigDecimal dec = this.number.multiply(multiplicandBD, mc);
        return new Money(dec, getCurrency(), monetaryContext);
    }
79552
public function multiply($factor)
    {
        $wrappedMoney = $this
            ->wrappedMoney
            ->multiply($factor);

        return self::create(
            $wrappedMoney->getAmount(),
            $this->getCurrency()
        );
    }
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;
    }
198830
public function multiply(self $x)
    {
        $value = gmp_mul($this->value, $x->value);

        return self::createFromGMPResource($value);
    }
1145045
public function Mod( $denominator )
	{
		$denominator = $denominator instanceof DecimalValue ? $denominator : Convert::ToDecimal( $denominator );

		if ( $denominator->getIsZero() )
			throw XPath2Exception::withErrorCode( "FOAR0001", Resources::FOAR0001 );

		if ( $denominator->getIsNAN() )
			throw XPath2Exception::withErrorCode( "FOAR0002", Resources::FOAR0002 );

		if ( $this->getIsNAN() || $this->getIsInfinite() )
			throw XPath2Exception::withErrorCode( "FOAR0002", Resources::FOAR0002 );

		$power = 0;
		// bcmod does not handle decimals so if they exist the powers of the two numbers must be increased until there are no decimals
		if ( $this->getIsDecimal() )
		{
			$power = strlen( $this->getIntegerPart() );
		}

		if ( $denominator->getIsDecimal() )
		{
			$power = max( strlen( $denominator->getIntegerPart() ), $power );
		}

		$multiplier = new DecimalValue( 10 );
		$multiplier = $multiplier->Pow( new DecimalValue( $power ) );
		$numerator = $this->Mul( $multiplier );
		$denominator = $denominator->Mul( $multiplier );
		$mod = bcmod( $numerator->getIntegerPart(), $denominator->getIntegerPart() );

		// Now need to divide by the multiplier to restore the correct power
		$mod = new DecimalValue( $mod );
		$mod = $mod->Div( $multiplier );
		return $mod;
	}
675014
public function multiply($b)
    {
        switch (true) {
            case $b instanceof Vector:
                $c = $this->multiplyVector($b);
                break;

            case $b instanceof Matrix:
                $c = $this->multiplyMatrix($b);
                break;

            case is_int($b) or is_float($b):
                $c = $this->multiplyScalar($b);
                break;

            default:
                throw new InvalidArgumentException('Cannot multiply vector'
                    . ' with a ' . gettype($b) . '.');
        }

        return $c;
    }
437838
public function convert(Currency $currency, $ratio, $roundingMode = self::ROUND_HALF_UP)
    {
        $this->currency = $currency;

        $this->assertOperand($ratio);
        $this->assertRoundingMode($roundingMode);

        if ($ratio < 1) {
            return $this->divide($ratio, $roundingMode);
        }

        return $this->multiply($ratio, $roundingMode);
    }
1123707
public function isSameValueAs(Fraction $fraction)
    {
        if ($this->getNumerator() != $fraction->getNumerator()) {
            return false;
        }

        if ($this->getDenominator() != $fraction->getDenominator()) {
            return false;
        }

        return true;
    }
196067
@Override
    public RoundedMoney multiply(Number multiplicand) {
        BigDecimal bd = MoneyUtils.getBigDecimal(multiplicand);
        if (isOne(bd)) {
            return this;
        }
        BigDecimal dec = number.multiply(bd, Optional.ofNullable(
                monetaryContext.get(MathContext.class)).orElse(MathContext.DECIMAL64));
        return new RoundedMoney(dec, currency, rounding).with(rounding);
    }
172205
public function multiply(float $factor, int $roundingMode) : Money
    {
        if (!in_array($roundingMode, self::$roundingModes, true)) {
            throw InvalidArgumentException::format(
                'Invalid rounding mode supplied to %s: expecting one of (%s), %s given',
                __METHOD__, Debug::formatValues(self::$roundingModes), $roundingMode
            );
        }

        return new Money((int)round($this->amount * $factor, 0, $roundingMode), $this->currency);
    }
267318
@Override
    public RoundedMoney multiply(Number multiplicand) {
        BigDecimal bd = MoneyUtils.getBigDecimal(multiplicand);
        if (isOne(bd)) {
            return this;
        }
        MathContext mc = monetaryContext.get(MathContext.class);
        if(mc==null){
            mc = MathContext.DECIMAL64;
        }
        BigDecimal dec = number.multiply(bd, mc);
        return new RoundedMoney(dec, currency, rounding).with(rounding);
    }
430219
public function base10($number)
    {
        if (!is_int($number)) {
            throw new \InvalidArgumentException('Expecting integer');
        }

        if ($this->integerPart === '0' && !$this->fractionalPart) {
            return $this;
        }

        $sign = '';
        $integerPart = $this->integerPart;

        if ($integerPart[0] === '-') {
            $sign = '-';
            $integerPart = substr($integerPart, 1);
        }

        if ($number >= 0) {
            $integerPart = ltrim($integerPart, '0');
            $lengthIntegerPart = strlen($integerPart);
            $integers = $lengthIntegerPart - min($number, $lengthIntegerPart);
            $zeroPad = $number - min($number, $lengthIntegerPart);

            return new self(
                $sign.substr($integerPart, 0, $integers),
                rtrim(str_pad('', $zeroPad, '0').substr($integerPart, $integers).$this->fractionalPart, '0')
            );
        }

        $number = abs($number);
        $lengthFractionalPart = strlen($this->fractionalPart);
        $fractions = $lengthFractionalPart - min($number, $lengthFractionalPart);
        $zeroPad = $number - min($number, $lengthFractionalPart);

        return new self(
            $sign.ltrim($integerPart.substr($this->fractionalPart, 0, $lengthFractionalPart - $fractions).str_pad('', $zeroPad, '0'), '0'),
            substr($this->fractionalPart, $lengthFractionalPart - $fractions)
        );
    }
669641
public function multiply($width, $height=null)
    {
        if ($width instanceof Size) {
            $height = $width->height();
            $width = $width->width();
        }

        $height = $height ? $height : $width;

        return new static($this->width()*$width, $this->height()*$height);
    }
1011646
public function multiply($factor)
    {
        if (!is_numeric($factor)) {
            throw new \InvalidArgumentException('Factor must be numeric');
        }

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

        return self::valueOf($amount, $this->currency);
    }
91038
public function toCurrencyWords($currency, $decimal, $fraction = null)
    {
        $return = '';
        $currency = strtoupper($currency);

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

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

        if ($decimal != '' && $decimal != 0) {
            $return = trim($this->toWords($decimal));
            $lev = ($decimal == 1) ? 0 : 1;

            if ($lev > 0) {
                if (count($currencyNames[0]) > 1) {
                    $return .= $this->wordSeparator . $currencyNames[0][$lev];
                } else {
                    $return .= $this->wordSeparator . $currencyNames[0][0];
                }
            } else {
                $return .= $this->wordSeparator . $currencyNames[0][0];
            }

            if (null !== $fraction) {
                $return .= $this->wordSeparator . 'og';
            }
        }

        if (null !== $fraction) {
            $return .= $this->wordSeparator . trim($this->toWords($fraction));
            $lev = ($fraction == 1) ? 0 : 1;

            if ($lev > 0) {
                if (count($currencyNames[1]) > 1) {
                    $return .= $this->wordSeparator . $currencyNames[1][$lev];
                } else {
                    $return .= $this->wordSeparator . $currencyNames[1][0];
                }
            } else {
                $return .= $this->wordSeparator . $currencyNames[1][0];
            }
        }

        return $return;
    }
177512
public function multiply($multiplier, $roundingMode = self::ROUND_HALF_UP, $precision = self::PRECISION_GAAP)
    {
        $this->assertRoundingMode($roundingMode);
        $multiplier = $this->castOperand($multiplier);
        $precision  = $this->castPrecision($precision);

        $amount = $this->amount->mul($multiplier, $this->getInnerPrecision() + 1);

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

        return $this->newInstance($amount);
    }