fibonacci/solution.c: prints negative numbers for n of 47 or more (F(90) prints -1581614984)
Los mantenedores suelen responder en 1 día
@tanujb03 ya está trabajando en esto.
Desde el 13/10/2026.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 25/100
Línea de trabajo
Start in problems/fibonacci/solution.c, where the value is computed in a type too narrow for F(47) and above, and compare with the Go, C++ and Python solutions. Add the failing inputs (47, 79, 90) to problems/fibonacci/cases.txt, then run python3 run.py fibonacci. Done when those inputs print 2971215073, 14472334024676221 and 2880067194370816120. Pull request #31 is already open against this, so check it before starting.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What I did
- Fresh checkout of
main, a C compiler. - Compile and run the C solution:
cd problems/fibonacci
gcc solution.c -o fib
echo 46 | ./fib
echo 47 | ./fib
echo 79 | ./fib
echo 90 | ./fib
What I expected
The problem README says: "Read n (0 <= n <= 90) and print the nth Fibonacci number ... F(90) is 2880067194370816120, so think about which number type can hold it." (problems/fibonacci/README.md)
So 47 should print 2971215073, 79 should print 14472334024676221, and 90 should print 2880067194370816120.
What happened instead
46 -> 1836311903 (correct)
47 -> -1323752223
79 -> -660827267
90 -> -1581614984
Every n from 47 to 90 is wrong. The Go, C++ and Python solutions print the correct values. python3 run.py fibonacci passes today because cases.txt has no input above 46.
Environment
code-corner main @ 0c95800, gcc 16.2, Windows 11.
I'd like to work on the fix for this, and add the failing inputs to cases.txt as the Contributing section asks.
- Lenguaje dominante
- Python
- Estrellas
- 1
- Forks
- 6
- Merge medio
- 22 h 59 min
- PR fusionados (30 d)
- 25
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de techcsispit/code-corner
-
Test runner reports success when no solutions are executedPosiblemente ocupada @vivek-3728 la tomó hace 1 día. Abiertobug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
techcsispit/code-corner#53 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
prime/solution.java doesn't compile: public class PrimeCheck in solution.java, README requires Solution.java with a Solution classPosiblemente ocupada @tanujb03 la tomó hace 11 días. Abiertobug good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
techcsispit/code-corner#35 ·
Los mantenedores suelen responder en 1 día
-
Failed compilations always report 0.000 secondsPosiblemente ocupada @Nik-2208 la tomó hace 8 días. Abiertobug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
techcsispit/code-corner#37 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de techcsispit/code-corner
Issues similares
-
bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
yunaremaia/proto-drift#22 ·
-
bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
yunaremaia/memwatch#96 ·
-
bug good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
yunaremaia/ci-gate-watch#34 ·
-
bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
yunaremaia/agent-capability-attestation#64 ·
Los mantenedores suelen responder en 1 día
-
bug good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
yunaremaia/agent-call-graph#43 ·
Los mantenedores suelen responder en 1 día