Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

fibonacci/solution.c: prints negative numbers for n of 47 or more (F(90) prints -1581614984)

オープン
#27 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@tanujb03 がすでに取り組んでいます。

2026年10月10日 から。

  • #31 @tanujb03 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
c, cpp, go, python
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

bug good first issue

What I did

  1. Fresh checkout of main, a C compiler.
  2. 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.

主要言語
Python
スター
1
フォーク
6
平均マージ
17時間 52分
マージ済み PR(30日)
14

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

techcsispit/code-corner のほかの issue

techcsispit/code-corner の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。