You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by "pjfanning (via GitHub)" <gi...@apache.org> on 2026/09/18 12:55:01 UTC
[PR] SUMPRODUCT, CORREL, PEARSON: error values instead of Infinity/NaN in the cell [poi]
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: dev-unsubscribe@poi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
Re: [PR] SUMPRODUCT, CORREL, PEARSON: error values instead of Infinity/NaN in the cell [poi]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning merged PR #1283:
URL: https://github.com/apache/poi/pull/1283
--
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: dev-unsubscribe@poi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org