/*
(non-Javadoc)
@see javax.money.MonetaryAmount#divide(javax.money.MonetaryAmount)
513592
@Override
    public RoundedMoney divide(Number divisor) {
        BigDecimal bd = MoneyUtils.getBigDecimal(divisor);
        if (isOne(bd)) {
            return this;
        }
        RoundingMode rm = monetaryContext.get(RoundingMode.class);
        if(rm==null){
            rm = RoundingMode.HALF_EVEN;
        }
        BigDecimal dec = number.divide(bd, rm);
        return new RoundedMoney(dec, currency, rounding).with(rounding);
    }
1043693
public FloatPoint Divide(FloatPoint point1, FloatPoint point2) {
        FloatPoint result = new FloatPoint(point1);
        result.Divide(point2);
        return result;
    }
425327
public function divide($number)
    {
        if (Number::isZero($number)) {
            throw new DivisionByZeroException;
        }

        $this->number = $this->number / $number;

        return $this;
    }
1135899
public final static Function<BigDecimal, BigDecimal> divideBy(byte divisor, RoundingMode roundingMode) {
        return divideBy(Byte.valueOf(divisor), roundingMode);
    }
910911
@Override
    public Money[] divideAndRemainder(double divisor) {
        if (NumberVerifier.isInfinityAndNotNaN(divisor)) {
            Money zero = Money.of(0, getCurrency());
            return new Money[]{zero, zero};
        }
        return divideAndRemainder(new BigDecimal(String.valueOf(divisor)));
    }
1266465
public static void divide(ComplexPolar_F64 a, ComplexPolar_F64 b, ComplexPolar_F64 result)
    {
        result.r = a.r/b.r;
        result.theta = a.theta - b.theta;
    }
1066628
public static int divide(int p, int q, RoundingMode mode) {
		return IntMath.divide(p, q, mode);
	}
1221384
public static void divide(final double[] values, final double divisor) {
		for (int i = values.length; --i >= 0;) {
			values[i] /= divisor;
		}
	}
624099
public double divideBy(Resource other) throws RuntimeException {
    if (other.getCpu() == 0 || other.getRam().isZero() || other.getDisk().isZero()) {
      throw new RuntimeException("Division by 0.");
    } else {
      double cpuFactor = Math.ceil(this.getCpu() / other.getCpu());
      double ramFactor = Math.ceil((double) this.getRam().asBytes() / other.getRam().asBytes());
      double diskFactor = Math.ceil((double) this.getDisk().asBytes() / other.getDisk().asBytes());
      return Math.max(cpuFactor, Math.max(ramFactor, diskFactor));
    }
  }
820156
public <N extends Number & Comparable<?>> NumberExpression<T> divide(Expression<N> right) {
        @SuppressWarnings("unchecked")
        Class<T> type = (Class<T>) getDivisionType(getType(), right.getType());
        return Expressions.numberOperation(type, Ops.DIV, mixin, right);
    }
219437
@Override
    public RoundedMoney subtract(MonetaryAmount subtrahend) {
        MoneyUtils.checkAmountParameter(subtrahend, currency);
        if (subtrahend.isZero()) {
            return this;
        }
        MathContext mc = monetaryContext.get(MathContext.class);
        if(mc==null){
            mc = MathContext.DECIMAL64;
        }
        return new RoundedMoney(number.subtract(subtrahend.getNumber().numberValue(BigDecimal.class), mc),
                currency, rounding);
    }
1204061
@Transformer
    public static String[] divide(Object o, String sep) {
        return str(o).split(sep);
    }
96596
@Override
    public int compareTo(MonetaryAmount o) {
        Objects.requireNonNull(o);
        int compare = getCurrency().getCurrencyCode().compareTo(o.getCurrency().getCurrencyCode());
        if (compare == 0) {
            compare = this.number.compareTo(Money.from(o).number);
        }
        return compare;
    }
157823
public static MonetaryAmount sum(MonetaryAmount a, MonetaryAmount b){
        MoneyUtils.checkAmountParameter(Objects.requireNonNull(a), Objects.requireNonNull(b.getCurrency()));
        return a.add(b);
    }
58324
public void divideValue(int idx, double val) {
        int c = get1dConfigIdx(idx);
        values.set(c, s.divide(values.get(c), val));
    }
550377
@Override
    public Money remainder(Number divisor) {
        if (NumberVerifier.isInfinityAndNotNaN(divisor)) {
            return new Money(BigDecimal.ZERO, getCurrency());
        }
        MathContext mc = MoneyUtils.getMathContext(monetaryContext, RoundingMode.HALF_EVEN);
        BigDecimal bd = MoneyUtils.getBigDecimal(divisor);
        return new Money(this.number.remainder(bd, mc), getCurrency(), monetaryContext);
    }
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());
    }