22<feed xmlns =" http://www.w3.org/2005/Atom" >
33 <title >cpprefjp - C++日本語リファレンス</title >
44 <link href =" https://cpprefjp.github.io" />
5- <updated >2026-03-26T01:36:51.338239 </updated >
6- <id >a225ff43-e7d8-4100-a3d5-87e3566e82cb </id >
5+ <updated >2026-03-26T01:51:43.893109 </updated >
6+ <id >fb82284f-9dd7-4d56-aa03-75b849592ac2 </id >
77
88
9+ <entry >
10+ <title >cmath -- cmath : NaNを受け取ったらNaNを返す仕様を記載 #373</title >
11+ <link href =" https://cpprefjp.github.io/reference/cmath.html" />
12+ <id >ee014a03a7ad925e7bcb66983976e0786e987f82:reference/cmath.md</id >
13+ <updated >2026-03-26T10:47:34+09:00</updated >
14+
15+ <summary type =" html" >< pre>< code> diff --git a/reference/cmath.md b/reference/cmath.md
16+ index e2402db78..8c440287f 100644
17+ --- a/reference/cmath.md
18+ +++ b/reference/cmath.md
19+ @@ -20,6 +20,7 @@
20+ - [乗算・加算](#floating-multiply-add)
21+ - [線形補完](#linear-interpolation)
22+ - [数値分類](#classification-functions)
23+ +- [NaNの扱い](#nan-handling)
24+ - [数値比較](#comparison-functions)
25+ - [型](#types)
26+ - [数値のマクロ](#value-macros)
27+ @@ -214,6 +215,35 @@ C++03 までの場合、[`errno`](cerrno/errno.md) でしか通知されない
28+ - [`math_errhandling`](cmath/math_errhandling.md) `& amp;` [`MATH_ERRNO`](cmath/math_errno.md)が真で、[`errno`](cerrno/errno.md)が設定された場合
29+
30+
31+ +## & lt;a id=& #34;nan-handling& #34; href=& #34;#nan-handling& #34;& gt;NaN の扱い& lt;/a& gt;
32+ +
33+ +浮動小数点規格ISO/IEC 60559 (IEEE 754) に準拠する環境では、C言語規格の Annex F (F.10 paragraph 11) により、以下の一般規則が定められている:
34+ +
35+ +& gt; NaN の引数をもつ関数は、NaN の結果を返し、浮動小数点例外を発生させない。ただし、個別に規定がある場合を除く。
36+ +
37+ +この規則は `__STDC_IEC_559__` が定義されている(ISO/IEC 60559 に準拠する)環境で適用される。
38+ +
39+ +また、推奨される実装として、ひとつ以上の NaN 引数をもつ関数が NaN を返す場合、その結果は入力の NaN 引数のいずれかと同じ値(型変換後、符号は異なる可能性がある)であることが望ましいとされている。
40+ +
41+ +### 例外となる関数
42+ +
43+ +以下の関数は、NaN の引数を受け取っても NaN を返さない場合がある:
44+ +
45+ +| 関数 | 条件 | 結果 |
46+ +|------|------|------|
47+ +| [`pow`](cmath/pow.md) | `pow(1.0, NaN)` | `1.0` |
48+ +| [`pow`](cmath/pow.md) | `pow(NaN, ±0.0)` | `1.0` |
49+ +| [`hypot`](cmath/hypot.md) | `hypot(±∞, NaN)` | `+∞` |
50+ +| [`fmax`](cmath/fmax.md) | 一方のみが NaN | NaN でない方の引数 |
51+ +| [`fmin`](cmath/fmin.md) | 一方のみが NaN | NaN でない方の引数 |
52+ +
53+ +[`pow`](cmath/pow.md) と [`hypot`](cmath/hypot.md) の例外は、NaN をどのような実数値に置き換えても結果が同じになるという原則に基づいている(任意の実数の 0 乗は 1、任意の実数と無限大の `hypot` は無限大)。
54+ +
55+ +[`fmax`](cmath/fmax.md) と [`fmin`](cmath/fmin.md) は、NaN を欠損値として扱い、有効な数値を優先して返す。ただし、両方の引数が NaN の場合は NaN を返す。
56+ +
57+ +なお、数値分類関数([`fpclassify`](cmath/fpclassify.md)、[`isnan`](cmath/isnan.md)、[`isinf`](cmath/isinf.md) 等)は戻り値が整数型であるため、NaN の伝播規則の対象外である。
58+ +
59+ +
60+ ## & lt;a id=& #34;trigonometric-functions& #34; href=& #34;#trigonometric-functions& #34;& gt;三角関数& lt;/a& gt;
61+
62+ | 名前 | 説明 | 対応バージョン |
63+ < /code>< /pre> </summary >
64+
65+ <author >
66+ <name >Akira Takahashi</name >
67+ <email >faithandbrave@gmail.com</email >
68+ </author >
69+ </entry >
70+
971 <entry >
1072 <title >locale::encoding -- text_encoding : コード修飾を追加 #1191</title >
1173 <link href =" https://cpprefjp.github.io/reference/locale/locale/encoding.html" />
@@ -4943,39 +5005,4 @@ index 000000000..609dbae5e
49435005 </author >
49445006 </entry >
49455007
4946- <entry >
4947- <title >format -- format : サンプルコードの出力を修正</title >
4948- <link href =" https://cpprefjp.github.io/reference/format/format.html" />
4949- <id >0fd244266081c2ea7358d81398a03077aa872b07:reference/format/format.md</id >
4950- <updated >2026-03-23T23:12:31+09:00</updated >
4951-
4952- <summary type =" html" >< pre>< code> diff --git a/reference/format/format.md b/reference/format/format.md
4953- index b4265b9d8..be84af4fe 100644
4954- --- a/reference/format/format.md
4955- +++ b/reference/format/format.md
4956- @@ -581,11 +581,11 @@ int main()
4957-
4958- #### 出力
4959- ```
4960- -[1, 2, 3]
4961- -[3, 2, 1]
4962- -[1, 2, 3]
4963- -{1: & #34;aaa& #34;, 2: & #34;bbb& #34;}
4964- -{1, 2, 3}
4965- +queue: [1, 2, 3]
4966- +priority_queue: [3, 2, 1]
4967- +stack: [1, 2, 3]
4968- +flat_map: {1: & #34;aaa& #34;, 2: & #34;bbb& #34;}
4969- +flat_set: {1, 2, 3}
4970- ```
4971-
4972- ### `vector& lt;bool& gt;`を出力する (C++23)
4973- < /code>< /pre> </summary >
4974-
4975- <author >
4976- <name >Raclamusi</name >
4977- <email >raclamusi@gmail.com</email >
4978- </author >
4979- </entry >
4980-
49815008</feed >
0 commit comments