Java in a Nutshell, 5th Edition [Electronic resources]

نسخه متنی -صفحه : 1191/ 350
نمايش فراداده

MathContextjava.math

Java 5.0serializable

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.MathContext

public 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 To

Too many methods to list.