Repository navigation
Fix powers of scientific literals and names ending in digits - #304
Draft
PawelTroka wants to merge 1 commit into
Draft
PawelTroka wants to merge 1 commit into
PawelTroka wants to merge 1 commit into
Conversation
This was referenced Oct 30, 2026
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.
Problem
The postfix-power translator recognizes a trailing digit sequence instead of the complete operand. Leading-dot fractions, separated digits, scientific notation, and identifiers ending in digits produce compilation errors or incorrect values.
For example,
2e-3²currently becomes2*e - pow(3,2)(approximately −3.563) instead of0.000004..5²,1_000²andvalue2²also generate incorrect C#.Change
Reuse the existing complete decimal-literal grammar for numeric power bases and require a boundary before the operand. Preserve unary precedence, existing implicit multiplication, grouped/symbolic powers, complex expressions, and literal shielding.
The production change is confined to one regex and its explanation in
PowHandler.cs.Validation
git diff --checkpassed.Commands:
dotnet test Computator.NET.Engine.Tests/Computator.NET.Engine.Tests.csproj -c Release dotnet build Computator.NET.Core.Tests/Computator.NET.Core.Tests.csproj -c Release -p:EnableWindowsTargeting=trueThe uploaded Git tree is
487f01bada101cf684ce5ef2cb48b4f322a657c6, identical to the locally tested commit's tree.Existing work
Reviewed all 78 open issues, the seven existing open PRs and recent merged work before selecting this fix. Merged #269 handles numeric literals in coefficient/division translation; merged #279 handles member/indexed power operands. Neither corrects this numeric-power regex. Open #294, #296, #298, #299, #300, #301 and #302 address separate charting, Mono and macOS behavior.
Independently based on master
fe1aba49b5f9538355ffaaa3d1683f69a23d2d9c. No PR has been merged. Draft while native CI is pending.Combined integration verification
Applied #304, #307, #308, #309 and #310 together in a separate local checkout; all five patches applied cleanly. The combined portable Engine suite passed 1,565/1,565 tests, with no failures or skips, and the combined Windows Desktop.Tests cross-build completed with zero errors (seven existing package/compiler warnings). Native Windows execution remains a CI gate. Each PR still targets
masterindependently.