Repository navigation
fix(formula): read complex numbers whose parts use a signed exponent - #8167
Merged
Merged
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #8167 +/- ##
==========================================
- Coverage 83.14% 83.14% -0.01%
==========================================
Files 3073 3073
Lines 202472 202469 -3
Branches 52719 52988 +269
==========================================
- Hits 168352 168347 -5
- Misses 34067 34069 +2
Partials 53 53 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
DR-Univer
approved these changes
Nov 11, 2026
DR-Univer
force-pushed
the
fix/complex-exponent-sign
branch
from
November 11, 2026 14:22
9c464e7 to
8eb52fd
Compare
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.
Complexfinds the sign between the real and imaginary parts with the first+or-after index 0. A signed exponent also contains one, so a value like1e-7-isplits at1e, the real part isNaN, and the number is treated as invalid.Complex.getComplexwrites such values itself.${1e-7}is1e-7, soCOMPLEX(0.0000001, -1)returns1e-7-i, andIMREAL,IMAGINARYand the otherIM*functions then reject that result. Excel reads these values (it returns1E-07-ifor the sameCOMPLEXcall andIMREALgives0.0000001).The sign search now skips a sign that follows
eorE. Values with two separators, such as1+2-3i, are still invalid.How to test
packages/engine-formula/src/basics/__tests__/complex.spec.tscovers1e-7-i,-1E+3-2e-3j, a round trip throughcreateByComplexStr(1e-7, -1, 'i'), and the two-separator case. The first three fail before the change and pass after it. I ran the spec with vitest againstcomplex.tsin a scratch project, not the full monorepo test suite.Pull Request Checklist
This PR was written with AI assistance; I reproduced the bug and checked the fix and tests myself.