Jump to content

Java.math: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
{{prod}} |Anything that needs to be said about this package should be included on Java Platform, Standard Edition
NickelShoe (talk | contribs)
so you mean {{merge}}--deprod
Line 1: Line 1:
{{lowercase|title=java.math}}
{{lowercase|title=java.math}}


{{mergeto|Java_Platform%2C_Standard_Edition#java.math}}'''<code>java.math</code>''' is a [[packages in Java|package]] in the [[Java programming language]], containing the [[Class (computer science)|classes]] for performing arbitrary-precision integer arithmetic and arbitrary-precision decimal arithmetic.
{{prod|Anything that needs to be said about this package should be included on [[Java Platform, Standard Edition]].}}
'''<code>java.math</code>''' is a [[packages in Java|package]] in the [[Java programming language]], containing the [[Class (computer science)|classes]] for performing arbitrary-precision integer arithmetic and arbitrary-precision decimal arithmetic.


To use the objects within this package in your Java code it is convenient to include the statement:
To use the objects within this package in your Java code it is convenient to include the statement:

Revision as of 18:40, 21 February 2006


java.math is a package in the Java programming language, containing the classes for performing arbitrary-precision integer arithmetic and arbitrary-precision decimal arithmetic.

To use the objects within this package in your Java code it is convenient to include the statement:

import java.math.*;

Package content

Classes

  • BigDecimal – provides arbitrary-precision signed decimal numbers. BigDecimal gives the user control over rounding behavior through RoundingMode.
  • BigInteger – provides arbitrary-precision integers. Operations on BigIntegers do not overflow or lose precision. In addition to standard arithmetic operations, it provides modular arithmetic, GCD calculation, primality testing, prime generation, bit manipulation, and other miscellaneous operations.
  • MathContext – encapsulate the context settings which describe certain rules for numerical operators.

Enums