I am evaluating this tool for an application I am writing. I require accurate representation that BigDecimal provides. I am running into a "java.lang.ArithmeticException: Rounding necessary" exception when trying to use the Power operator for some calculations, even though I passed in a "MathContext.DECIMAL64"(I believe this denotes "Half up" rounding to 16 places) to the BigDecComponents() constructor. Here is my code:
Jep jep = new Jep( new BigDecComponents(MathContext.DECIMAL64));
String math = ".1 ^ .2";
Object evaluate = jep.evaluate();
I am aware that I can write my own power operator function, I am just curious why this tool does not use the rounding method associated with
MathContext.DECIMAL64 or even any specified rounding passed in using other Mathcontext constructors.