pjfanning opened a new pull request, #1283:
URL: https://github.com/apache/poi/pull/1283
Follow-up to #1281 (which fixed the same leak in `DSTDEV`/`DVAR`). Excel
never stores NaN or Infinity in a cell — it reports `#NUM!`/`#DIV/0!` — and
`NumberToTextConverter` renders them as `2.6965397022935E+308` /
`1.7976931348623E+308`, so a leaked one also displays as garbage.
- `SUMPRODUCT({1E200},{1E200})` put `Infinity` in the cell. Now `#NUM!` via
`NumericFunction.checkValue`, the same as `SUM(1E308,1E308)` and
`PRODUCT(1E200,1E200)` already do (`MultiOperandNumericFunction` has that
check; `Sumproduct` didn't).
- `CORREL`/`PEARSON` (same implementation) of a zero-variance array — e.g.
`CORREL({1,1},{1,2})` — put `NaN` in the cell; Excel gives `#DIV/0!`. Same for
fewer than two pairs, where commons-math threw and the catch-all turned it into
`#N/A`.
Tests: `TestSumproduct.testOverflowIsNumError`,
`TestCorrel.testZeroVarianceIsDiv0`. Ran those with
`TestFormulasFromSpreadsheet` locally: 402 tests, 0 failures.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]