BigReal implements FieldElement<BigReal>, Comparable<BigReal>, Serializable { public BigDecimal bigDecimalValue() { return 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 testBigDecimalValue() { BigDecimal pi = new BigDecimal( "3.1415926535897932384626433832795028841971693993751"); Assert.assertEquals(pi, new BigReal(pi).bigDecimalValue()); Assert.assertEquals(new BigDecimal(0.5), new BigReal(1.0 / 2.0).bigDecimalValue()); }