Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

A difference of two intervals has the wrong ends, and loses a piece when the second lies inside the first

Aperta
#2,290 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
backend

Direzione di ricerca

Start with Sources/AngouriMath/Core/Entity/Omni/Sets/SetOperators.SetSubtraction.cs, especially SetSubtractIntervalAndInterval, whose final returns the issue identifies. Find the existing tests for interval subtraction and add coverage for the listed endpoint and containment cases. Done means the results preserve the correct interval pieces and endpoints, and membership agrees with those results.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

A difference of two intervals, on master (87a0eff), Simplify():

Answered Should be
[0; 10] \ (2; 3) [0; 3] [0; 2] \/ [3; 10]
[0; 10] \ [2; 3] (0; 3] [0; 2) \/ (3; 10]
(0; 10) \ (2; 3) [0; 3) (0; 2] \/ [3; 10)
[0; 10] \ [-1; 3) (3; 10] [3; 10]
[0; 10] \ (-1; 3] [3; 10] (3; 10]
[0; 10] \ (5; 12] [0; 5) [0; 5]
[0; 10] \ [5; 12) [0; 5] [0; 5)
[0; 10] \ (0; 3) [3; 10] { 0 } \/ [3; 10]
[0; 10] \ (7; 10) [0; 7] [0; 7] \/ { 10 }

Evaled gives the same sets, and membership follows them: 5 in ([0; 10] \ (2; 3)) simplifies to False. A finite set on the right, [0; 10] \ { 5 }, is left as it is, which is right.

The cause is the last three returns of SetOperators.SetSubtractIntervalAndInterval:

  • When B lies strictly inside A, the fallback builds one interval from A's left end to B's right end, where the answer is the two pieces on either side of B.
  • When B covers one end of A, the end of the cut is read from B's other end (!B.LeftClosed at bRight, !B.RightClosed at bLeft), so it comes out right only when B is closed at both ends or open at both.
  • When A and B share an end that A contains and B does not, that point is folded into the flag of the cut instead of being kept as { a }.

Found while building a number-line view of \ for browser demos of the library.

Lingua principale
C#
Stelle
831
Fork
79
Merge medio
1h 10m
PR unite (30g)
531

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ASC-Community/AngouriMath

Tutte le issue di ASC-Community/AngouriMath

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.