BigReal implements FieldElement<BigReal>, Comparable<BigReal>, Serializable { public int compareTo(BigReal a) { return d.compareTo(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 testCompareTo() { BigReal first = new BigReal(1.0 / 2.0); BigReal second = new BigReal(1.0 / 3.0); BigReal third = new BigReal(1.0 / 2.0); Assert.assertEquals(0, first.compareTo(first)); Assert.assertEquals(0, first.compareTo(third)); Assert.assertEquals(1, first.compareTo(second)); Assert.assertEquals(-1, second.compareTo(first)); }