Package com.singularsys.jep.bigdecimal
package com.singularsys.jep.bigdecimal
A set of components for performing arbitrary precision arithmetic using the
BigDecimal class to represent numbers.
The package can be setup in a number of different ways using the
BigDecComponents class:
- With unlimited precision, some operators like division will fail
- Using a
MathContextspecifying the number of significant figures, and rounding mode. - Fixed-point setup, with a specified number of decimal places to use for all results. (Since Jep 4.1)
// unlimited precision
jep = new Jep(new BigDecComponents());
// With the DECIMAL64, 16 digits and a rounding mode of half-even.
jep = new Jep(new BigDecComponents(MathContext.DECIMAL64));
// Fixed-point arithmetic with 2 decimal places, and a rounding mode of half-even.
jep = new Jep(new BigDecComponents(2));
// Fixed-point arithmetic with 2 decimal places, and a rounding mode of half-even
// and string support.
jep = new Jep(new BigDecComponents(MathContext.DECIMAL64, 2, false));
- See Also:
-
ClassDescriptionA set of components for working with big decimal numbers.A function table for BigDecimals.A NumberFactory producing BigDecimal objects.A set of operators for using BigDecimal numbersFunctions, operators and components that support fixed precision operations.