This simple class represents a precision (number of significant digits) and a RoundingMode to be used in BigDecimal arithmetic. The constants are predefined MathContext objects that can be used to select unlimited precision arithmetic or to select specific operating modes that match decimal floating-point modes defined by the IEEE 754R standard. Figure 11-3. java.math.MathContextpublic final class MathContext implements Serializable { // Public Constructors public MathContext (int setPrecision ); public MathContext (String val ); public MathContext (int setPrecision , RoundingMode setRoundingMode ); // Public Constants public static final MathContext DECIMAL128 ; public static final MathContext DECIMAL32 ; public static final MathContext DECIMAL64 ; public static final MathContext UNLIMITED ; // Public Instance Methods public int getPrecision ( ); public RoundingMode getRoundingMode ( ); // Public Methods Overriding Object public boolean equals (Object x ); public int hashCode ( ); public String toString ( ); } Passed ToToo many methods to list. |