Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#2,290 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
csharp
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
C#
Estrellas
831
Forks
79
Merge medio
1 h 10 min
PR fusionados (30 d)
531

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de ASC-Community/AngouriMath

Todos los issues de ASC-Community/AngouriMath

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.