
|
Computer systems can provide an arithmetic that gives the results that
people expect, instead of the results that binary floating point
calculations give (see the sidebar on the right for an example).
This is not available in Java today, so a decimal floating point
arithmetic is needed one which gives the same results as the
arithmetic that people learn at school (see the
Decimal
Arithmetic FAQ for more details).
This site describes an enhanced BigDecimal class (com.ibm.math.BigDecimal) for Java, which is the basis for a proposed enhancement to java.math.BigDecimal. Please see the Java Specification Request (JSR) for details of the proposal. This JSR is proceeding to plan; you can find changes from this design in the Decimal Arithmetic Enhancement Public Review Draft. The com.ibm.math.BigDecimal class (and its supporting class, MathContext) is fully implemented and is available below, and is also included with IBM's Java developer kits as of version 1.1.8. The new class extends the existing class with the floating point arithmetic from ANSI X3.274, which does arithmetic the way people do. This makes it especially easy to add human-oriented arithmetic to your applications. Here, you'll find:
|
|
|
Copyright © IBM Corporation 1998, 2002. All rights reserved.
Java is a trademark of Sun Microsystems Inc. |
|
[
IBM home page |
Search |
Contact IBM |
Help |
Terms of use |
Privacy
]