https://bz.apache.org/bugzilla/show_bug.cgi?id=69892

--- Comment #8 from [email protected] ---
Might be this commit which caused the regression:
https://github.com/apache/poi/commit/66e16a89578254f7a20d350ed7b58bcaa4cc5268?diff=unified

I'll attach an LLM generated junit test and analysis which according to it
shows the reason of the regression.
The test class demonstrates the difference between:
- Native Java double multiplication
- BigDecimal multiplication based on a text conversion with 15 significant
digits (mimicking what NumberToTextConverter.toText() does in Apache POI after
the commit)

Here's what happens
- sqrt(666.0) yields a double value of approximately 25.80697580112788.
- NumberToTextConverter.toText(d) produces a textual representation with 15
significant digits (Excel-like).
- For the rootOfEvil value, this results in the string version:
"25.8069758011279"
- POI performs BigDecimal("25.8069758011279") * BigDecimal("25.8069758011279")
-> the BigDecimal product becomes 666.0000000000010160...
- Finally, the result is converted back using doubleValue() -> 666.000000000001

I've run the test and it shows the problem.

-- 
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]

Reply via email to