Skip to content

Commit

Permalink
<cmath> : constexpr対応の説明見直し
Browse files Browse the repository at this point in the history
  • Loading branch information
faithandbrave committed Feb 16, 2023
1 parent 182e098 commit 019f15e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion reference/cmath.md
Expand Up @@ -87,7 +87,7 @@

### <a id="cpp23" href="#cpp23">C++23での差異</a>
#### constexpr対応
C++23では、多くの数学関数が`constexpr`に対応し、定数式内で使用できるようになった。C++23時点では、コンパイラベンダの負担が低い機能を`constexpr`対応した。
C++23では、多くの数学関数が`constexpr`に対応し、定数式内で使用できるようになった。C++23時点では、コンパイラベンダの負担が少ない機能を`constexpr`対応した。

C++23で`constexpr`対応する関数の条件は以下:

Expand All @@ -98,6 +98,8 @@ C++23で`constexpr`対応する関数の条件は以下:

[`nearbyint`](cmath/nearbyint.md)は2. の条件を満たさないため、C++23では`constexpr`に対応しない。

ただし、コンパイラが先行して`constexpr`非対応の関数も対応している可能性がある。

なお、C++20では[`lerp()`](cmath/lerp.md)のみ`constexpr`に対応している。これはC標準ライブラリからの移植ではなく、C++で標準化された関数だからである ([`errno`](cerrno/errno.md)や浮動小数点例外のようなグローバル状態を使用しない)。

#### 拡張浮動小数点数型への対応
Expand Down

0 comments on commit 019f15e

Please sign in to comment.