Java.math: Difference between revisions
Appearance
Content deleted Content added
No edit summary |
m lowercase title template, category |
||
Line 1: | Line 1: | ||
{{ |
{{lowercase|title=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. |
'''<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. |
||
Line 6: | Line 5: | ||
To use the objects within this package in your Java code be sure to include the statement: |
To use the objects within this package in your Java code be sure to include the statement: |
||
import java.math.*; |
import java.math.*; |
||
==Package content== |
==Package content== |
||
Line 18: | Line 16: | ||
*<code>RoundingMode</code> - provides eight rounding behaviors. |
*<code>RoundingMode</code> - provides eight rounding behaviors. |
||
==External links== |
==External links== |
||
* [http://java.sun.com/j2se/1.5.0/docs/api/java/math/package-tree.html Class hierarchy on java.sun.com] |
* [http://java.sun.com/j2se/1.5.0/docs/api/java/math/package-tree.html Class hierarchy on java.sun.com] |
||
[[Category:Java programming language]] |
Revision as of 03:12, 1 October 2005
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 be sure 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 throughRoundingMode
.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
RoundingMode
- provides eight rounding behaviors.