Repository navigation
This closes #2414, make a negative zero the same zero as any other - #2424
Merged
Merged
Conversation
The cofactors of a 2x2 matrix are 1x1 determinants. Without a 1x1 case they fell into the Laplace expansion, which takes the minor of a 1x1 matrix, gets an empty matrix and sums over nothing, so every cofactor was 0 and MINVERSE of a 2x2 matrix was all zeros. MDETERM was not affected because `det` has its own 2x2 branch and never descends, which is why the existing tests did not catch it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: PhilflowIO <tech@philflow.io>
A negative zero formats as "-0" and the equality operators compare the formatted text, so `x = 0` was FALSE for a value that is zero. COUNTIF does not go through the comparison operators and saw the same thing, which is why this is fixed where the number is made and not where it is compared. The ordering operators compare the numbers and were never affected. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: PhilflowIO <tech@philflow.io>
xuri
requested changes
Oct 8, 2026
xuri
approved these changes
Oct 8, 2026
xuri
left a comment
Member
There was a problem hiding this comment.
Thanks for your pull request. I resolved code conflicts and made some changes based on your code branch.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2424 +/- ##
=======================================
Coverage 99.72% 99.72%
=======================================
Files 32 32
Lines 32524 32527 +3
=======================================
+ Hits 32434 32437 +3
Misses 88 88
Partials 2 2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Details
Description
Normalises a negative zero in
newNumberFormulaArg. Every number the engine produces passes through that constructor, so one place covers all paths.Related Issue
Closes #2414
Depends on the MINVERSE fix in #MMMM. On its own this change breaks the existing expectation
"MINVERSE(A1:B2)": "-0", because the 2x2 inverse is all zeros until that one lands.Motivation and Context
A negative zero formats as "-0" and the equality operators compare the formatted text, so
x = 0was FALSE for a value that is zero. COUNTIF does not go through the comparison operators and saw the same thing, which is why this is fixed where the number is made and not where it is compared. The ordering operators compare the numbers and were never affected.How Has This Been Tested
Cases added to
TestCalcCellValue: a cell holding=(1=2)*-1read back, compared with=and<>, used as an IF condition, and counted with COUNTIF. Ordering operators and ordinary zeros are covered as unchanged.go test ./...passes on go1.26.8 linux/amd64.gofmt -s -l .is empty.Types of changes
Checklist
This branch also contains the commit from #2420. Only the second commit belongs to this PR; after #2420 is merged this branch will be rebased so that the diff is the negative zero change alone.