Java Code Examples for org.apache.commons.math3.exception.util.LocalizedFormats#ZERO_NOT_ALLOWED

The following examples show how to use org.apache.commons.math3.exception.util.LocalizedFormats#ZERO_NOT_ALLOWED . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BigReal.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@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);
    }
}
 
Example 2
Source File: BigReal.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@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);
    }
}
 
Example 3
Source File: BigReal.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@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 occured
        throw new MathArithmeticException(LocalizedFormats.ZERO_NOT_ALLOWED);
    }
}
 
Example 4
Source File: BigReal.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@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 occured
        throw new MathArithmeticException(LocalizedFormats.ZERO_NOT_ALLOWED);
    }
}
 
Example 5
Source File: BigReal.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@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);
    }
}
 
Example 6
Source File: BigReal.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * @throws MathArithmeticException if {@code this} is zero
 */
public BigReal reciprocal() {
    try {
        return new BigReal(BigDecimal.ONE.divide(d, scale, roundingMode));
    } catch (ArithmeticException e) {
        // Division by zero has occured
        throw new MathArithmeticException(LocalizedFormats.ZERO_NOT_ALLOWED);
    }
}
 
Example 7
Source File: BigReal.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * @throws MathArithmeticException if {@code a} is zero
 */
public BigReal divide(BigReal a) {
    try {
        return new BigReal(d.divide(a.d, scale, roundingMode));
    } catch (ArithmeticException e) {
        // Division by zero has occured
        throw new MathArithmeticException(LocalizedFormats.ZERO_NOT_ALLOWED);
    }
}
 
Example 8
Source File: BigReal.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@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);
    }
}
 
Example 9
Source File: BigReal.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * @throws MathArithmeticException if {@code this} is zero
 */
public BigReal reciprocal() {
    try {
        return new BigReal(BigDecimal.ONE.divide(d, scale, roundingMode));
    } catch (ArithmeticException e) {
        // Division by zero has occured
        throw new MathArithmeticException(LocalizedFormats.ZERO_NOT_ALLOWED);
    }
}
 
Example 10
Source File: BigReal.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@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);
    }
}
 
Example 11
Source File: BigReal.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@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 occured
        throw new MathArithmeticException(LocalizedFormats.ZERO_NOT_ALLOWED);
    }
}
 
Example 12
Source File: BigReal.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@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 occured
        throw new MathArithmeticException(LocalizedFormats.ZERO_NOT_ALLOWED);
    }
}
 
Example 13
Source File: BigReal.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@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);
    }
}
 
Example 14
Source File: BigReal.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@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);
    }
}
 
Example 15
Source File: ZeroException.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Construct the exception.
 */
public ZeroException() {
    this(LocalizedFormats.ZERO_NOT_ALLOWED);
}
 
Example 16
Source File: ZeroException.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Construct the exception.
 */
public ZeroException() {
    this(LocalizedFormats.ZERO_NOT_ALLOWED);
}
 
Example 17
Source File: ZeroException.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Construct the exception.
 */
public ZeroException() {
    this(LocalizedFormats.ZERO_NOT_ALLOWED);
}
 
Example 18
Source File: ZeroException.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Construct the exception.
 */
public ZeroException() {
    this(LocalizedFormats.ZERO_NOT_ALLOWED);
}
 
Example 19
Source File: ZeroException.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Construct the exception.
 */
public ZeroException() {
    this(LocalizedFormats.ZERO_NOT_ALLOWED);
}
 
Example 20
Source File: ZeroException.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Construct the exception.
 */
public ZeroException() {
    this(LocalizedFormats.ZERO_NOT_ALLOWED);
}