Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

`3 i` parses as `3 ^ i`: an imaginary literal after a factor is read as its exponent

Offen
#1,503 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
70/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
csharp
Bereich
compilers

Rechercherichtung

Start with Syntax.md and SyntaxDocumentedTest, which document and pin the current juxtaposition rule. Trace the parser entry point used by ToEntity() and inspect how imaginary literals are classified after a factor. Done means the proposed imaginary-literal cases parse as multiplication, existing power cases remain unchanged, and the documentation test reflects the new rule.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

3 i parses as 3 ^ i, not 3 * i, so sin(3 i) is evaluated at 3^i (about 0.455 + 0.891i):

"sin(3 i)".ToEntity()   ->  sin(3 ^ i)
"x i".ToEntity()        ->  x ^ i
"(1 + 2) i".ToEntity()  ->  (1 + 2) ^ i
"2 i x".ToEntity()      ->  2 ^ i * x

2.5.0 does the same. The juxtaposition rule inserts ^ before a number written after a number, a name or ), so that x2 is x ^ 2. The lexer reads i as a number, so the rule applies to it as well. Syntax.md records this as a consequence of the rule since #1041, and SyntaxDocumentedTest pins "x i" as "x ^ i".

Proposal: an imaginary literal written after a factor is a factor too. 3 i would be 3 * i and x 2i would be x * 2i, while x2, 3 2 and (x + 1)2 stay powers. 3i, written as one literal, is already 3i. I'd change the rule and the documented row together. Is that the reading you want?

Vorherrschende Sprache
C#
Sterne
831
Forks
79
Ø Merge
2 Std. 22 Min.
Gemergte PRs (30 T.)
507

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus ASC-Community/AngouriMath

Alle Issues in ASC-Community/AngouriMath

Ähnliche Issues

Weitere Issues zu C#

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.