fibonacci/solution.c: prints negative numbers for n of 47 or more (F(90) prints -1581614984)
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 25/100
調査の方向性
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 の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 1
- フォーク
- 6
- 平均マージ
- 17時間 52分
- マージ済み PR(30日)
- 14
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
techcsispit/code-corner のほかの issue
-
prime/solution.java doesn't compile: public class PrimeCheck in solution.java, README requires Solution.java with a Solution class対応中かも @tanujb03 が 3 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
techcsispit/code-corner#35 ·
メンテナーはふだん 1 日以内に返信
-
Prime solution in C++ incorrectly returns true for some composite numbers対応中かも @paramsj が 2 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 25/100
techcsispit/code-corner#38 ·
メンテナーはふだん 1 日以内に返信
-
Failed compilations always report 0.000 seconds対応中かも @Shivangi-singh18 が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
techcsispit/code-corner#37 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
run.py: Python solutions are skipped on Windows when run via python instead of python3対応中かも @tanujb03 が 3 日前に担当しました。 オープンbug good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 15/100
techcsispit/code-corner#29 ·
メンテナーはふだん 1 日以内に返信
-
binary-search/Solution.java: prints -1 when the target is the last element (`9 1 3 5 7 9`) or in a 1-element list (`5 5`)対応中かも @tanujb03 が 3 日前に担当しました。 オープンbug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 22/100
techcsispit/code-corner#26 ·
メンテナーはふだん 1 日以内に返信
techcsispit/code-corner の issue をすべて見る
似ている issue
-
effort: low prio: low ready
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
digitalfabrik/integreat-cms#4616 ·
メンテナーはふだん 5 日以内に返信
-
bug difficulty:2 good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
MakazhanAlpamys/Soup#1865 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
FinanceFlash/unvibecode#233 ·
メンテナーはふだん 1 日以内に返信
-
area: agents area: docs good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
openapi/gknowledge#23 ·
-
useless-suppression reported for deprecated-* messages that should be exempt対応中かも @adityasinha-ghub が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
pylint-dev/pylint#11656 ·
メンテナーはふだん 1 日以内に返信