https://bz.apache.org/bugzilla/show_bug.cgi?id=66389
Bug ID: 66389
Summary: POI formula eval result is not same with excel when do
an arithmetic operation
Product: POI
Version: 5.2.2-FINAL
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: POI Overall
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
Created attachment 38449
--> https://bz.apache.org/bugzilla/attachment.cgi?id=38449&action=edit
test method
When I upgrade the POI version to 5.2.2, some formula eval result changed, for
example
formula is "=B1*SQRT(B2)"
when set B1 = 1.2
set B2 = 5.678
Expected :2.85942651592937
Actual :2.85942651592938
It seems that this program convert these 2 args to 15 digits of precision
`before multiply operation` firstly, but Excel convert to 15 digits `after
multiply operation`.
```
public static final Function MultiplyEval = new TwoOperandNumericOperation() {
@Override
protected double evaluate(double d0, double d1) {
BigDecimal bd0 = new BigDecimal(NumberToTextConverter.toText(d0));
BigDecimal bd1 = new BigDecimal(NumberToTextConverter.toText(d1));
return bd0.multiply(bd1).doubleValue();
}
}
```
This test not occured in POI 4.1.2.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]