/** {@inheritDoc} */ public BigReal add(BigReal a) { return new BigReal(d.add(a.d)); }
/** {@inheritDoc} */ public BigReal multiply(BigReal a) { return new BigReal(d.multiply(a.d)); }
/** {@inheritDoc} */ public BigReal negate() { return new BigReal(d.negate()); }
/** {@inheritDoc} */ public BigReal subtract(BigReal a) { return new BigReal(d.subtract(a.d)); }
/** {@inheritDoc} */ public BigReal multiply(final int n) { return new BigReal(d.multiply(new BigDecimal(n))); }
/** * {@inheritDoc} * * @throws MathArithmeticException if {@code this} is zero */ public BigReal reciprocal() throws MathArithmeticException { try { return new BigReal(BigDecimal.ONE.divide(d, scale, roundingMode)); } catch (ArithmeticException e) { // Division by zero has occurred throw new MathArithmeticException(LocalizedFormats.ZERO_NOT_ALLOWED); } }
/** * {@inheritDoc} * * @throws MathArithmeticException if {@code a} is zero */ public BigReal divide(BigReal a) throws MathArithmeticException { try { return new BigReal(d.divide(a.d, scale, roundingMode)); } catch (ArithmeticException e) { // Division by zero has occurred throw new MathArithmeticException(LocalizedFormats.ZERO_NOT_ALLOWED); } }
/** {@inheritDoc} */ public BigReal multiply(BigReal a) { return new BigReal(d.multiply(a.d)); }
/** {@inheritDoc} */ public BigReal subtract(BigReal a) { return new BigReal(d.subtract(a.d)); }
/** {@inheritDoc} */ public BigReal negate() { return new BigReal(d.negate()); }
/** {@inheritDoc} */ public BigReal add(BigReal a) { return new BigReal(d.add(a.d)); }
/** {@inheritDoc} */ public BigReal add(BigReal a) { return new BigReal(d.add(a.d)); }
/** {@inheritDoc} */ public BigReal negate() { return new BigReal(d.negate()); }
/** {@inheritDoc} */ public BigReal subtract(BigReal a) { return new BigReal(d.subtract(a.d)); }
/** {@inheritDoc} */ public BigReal multiply(BigReal a) { return new BigReal(d.multiply(a.d)); }
/** {@inheritDoc} */ public BigReal multiply(final int n) { return new BigReal(d.multiply(new BigDecimal(n))); }
/** {@inheritDoc} */ public BigReal multiply(final int n) { return new BigReal(d.multiply(new BigDecimal(n))); }
/** * {@inheritDoc} * * @throws MathArithmeticException if {@code a} is zero */ public BigReal divide(BigReal a) throws MathArithmeticException { try { return new BigReal(d.divide(a.d, scale, roundingMode)); } catch (ArithmeticException e) { // Division by zero has occurred throw new MathArithmeticException(LocalizedFormats.ZERO_NOT_ALLOWED); } }
/** * {@inheritDoc} * * @throws MathArithmeticException if {@code this} is zero */ public BigReal reciprocal() throws MathArithmeticException { try { return new BigReal(BigDecimal.ONE.divide(d, scale, roundingMode)); } catch (ArithmeticException e) { // Division by zero has occurred throw new MathArithmeticException(LocalizedFormats.ZERO_NOT_ALLOWED); } }
/** * {@inheritDoc} * * @throws MathArithmeticException if {@code a} is zero */ public BigReal divide(BigReal a) throws MathArithmeticException { try { return new BigReal(d.divide(a.d, scale, roundingMode)); } catch (ArithmeticException e) { // Division by zero has occurred throw new MathArithmeticException(LocalizedFormats.ZERO_NOT_ALLOWED); } }