API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.math. MathContext View Source
Author(s)
Mike Cowlishaw
Joseph D. Darcy
Since
1.5
Version
Serial
Hierarchy
 Object
      MathContext
Implements
 Serializable
Subclasses
Description
publicfinal class MathContext
  Immutable objects which encapsulate the context settings which describe certain rules for numerical operators, such as those implemented by the BigDecimal class.
See also:    BigDecimal RoundingMode
Constructors
public MathContext (int setPrecision)
  Constructs a new MathContext with the specified precision and the HALF_UP rounding mode.
public MathContext (int setPrecision, RoundingMode setRoundingMode)
  Constructs a new MathContext with a specified precision and rounding mode.
public MathContext (String val)
  Constructs a new MathContext from a string.
Methods
Hide/Show inherited methods
public boolean equals (Object x)
  Compares this MathContext with the specified Object for equality.
public int getPrecision ()
  Returns the precision setting.
public RoundingMode getRoundingMode ()
  Returns the roundingMode setting.
public int hashCode ()
  Returns the hash code for this MathContext.
public String toString ()
  Returns the string representation of this MathContext.
Fields
Hide/Show inherited fields
publicfinalstatic MathContext DECIMAL128
A MathContext object with a precision setting matching the IEEE 754R Decimal128 format, 34 digits, and a rounding mode of HALF_EVEN, the IEEE 754R default.
publicfinalstatic MathContext DECIMAL32
A MathContext object with a precision setting matching the IEEE 754R Decimal32 format, 7 digits, and a rounding mode of HALF_EVEN, the IEEE 754R default.
publicfinalstatic MathContext DECIMAL64
A MathContext object with a precision setting matching the IEEE 754R Decimal64 format, 16 digits, and a rounding mode of HALF_EVEN, the IEEE 754R default.
pack-privatefinal int precision
  The number of digits to be used for an operation.
pack-privatetransient BigInteger roundingMax
  Lookaside for the rounding points (the numbers which determine whether the coefficient of a number will require rounding).
pack-privatetransient BigInteger roundingMin
pack-privatefinal RoundingMode roundingMode
  The rounding algorithm to be used for an operation.
publicfinalstatic MathContext UNLIMITED
  A MathContext object whose settings have the values required for unlimited precision arithmetic.
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar