BigReal implements FieldElement<BigReal>, Comparable<BigReal>, Serializable { public BigReal subtract(BigReal a) { return new BigReal(d.subtract(a.d)); } BigReal(BigDecimal val);  BigReal(BigInteger val);  BigReal(BigInteger unscaledVal, int scale);  BigReal(BigInteger unscaledVal, int scale, MathContext mc);  BigReal(BigInteger val, MathContext mc);  BigReal(char[] in);  BigReal(char[] in, int offset, int len);  BigReal(char[] in, int offset, int len, MathContext mc);  BigReal(char[] in, MathContext mc);  BigReal(double val);  BigReal(double val, MathContext mc);  BigReal(int val);  BigReal(int val, MathContext mc);  BigReal(long val);  BigReal(long val, MathContext mc);  BigReal(String val);  BigReal(String val, MathContext mc); RoundingMode getRoundingMode(); void setRoundingMode(RoundingMode roundingMode); int getScale(); void setScale(int scale); BigReal add(BigReal a); BigReal subtract(BigReal a); BigReal negate(); BigReal divide(BigReal a); BigReal reciprocal(); BigReal multiply(BigReal a); BigReal multiply(final int n); int compareTo(BigReal a); double doubleValue(); BigDecimal bigDecimalValue(); @Override boolean equals(Object other); @Override int hashCode(); Field<BigReal> getField(); static final BigReal ZERO; static final BigReal ONE; }
@Test public void testSubtract() { BigReal a = new BigReal("1.2345678"); BigReal b = new BigReal("8.7654321"); Assert.assertEquals(-7.5308643, a.subtract(b).doubleValue(), 1.0e-15); }