[ub:expr.mul.div.by.zero] Code comment does not agree with normative wording
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- ドキュメント
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- cpp, tex
調査の方向性
[ub:expr.mul.div.by.zero] の例から始め、そのコメントを [expr.mul]/4 の規範的な文言および [expr.pre]/4 の注記と比較してください。浮動小数点のゼロ除算に関する記述がこれらの箇所と一致するように例を修正し、その後、リンク先の文言の整合性を確認してください。
索引モデルが issue の本文から書いたものです。
説明
int main() { int x = 1 / 0; // undefined behavior, division by zero double d = 1.0 / 0.0; // undefined behavior on systems where the range of // representable values of double is [-max,+max], on systems where // representable values is [-inf,+inf] this would not be undefined behavior }
The normative wording is ([expr.mul]/4):
If the second operand of / or % is zero, the behavior is undefined ([ub:expr.mul.div.by.zero]).
That is, the behavior of 1.0 / 0.0 is undefined even on systems that have positive and negative infinity.
In addition, a note in [expr.pre]/4 (added by P3899R3 "Clarify the behavior of floating-point overflow") mentions:
If the operands are of a type that adheres to ISO/IEC 60559, division by zero is the only case where an arithmetic expression has undefined behavior ([expr.mul]).
- 主要言語
- TeX
- スター
- 221
- フォーク
- 813
- 平均マージ
- 17時間 45分
- マージ済み PR(30日)
- 34
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cplusplus/draft のほかの issue
-
P2-Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
P2-Bug
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
cplusplus/draft の issue をすべて見る
似ている issue
-
content
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
GDQuest/learn-gdscript#1395 ·
-
rules
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
HttpClient
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
symfony/symfony-docs#23092 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
huggingface/sentence-transformers#4074 ·