Closed faithandbrave closed 1 year ago
C++14の規格 (N3936) では、以下の文章がそれにあたるかと思います。
Moreover, there shall be additional overloads sufficient to ensure:
- If any arithmetic argument corresponding to a double parameter has type long double, then all arithmetic arguments corresponding to double parameters are effectively cast to long double.
- Otherwise, if any arithmetic argument corresponding to a double parameter has type double or an integer type, then all arithmetic arguments corresponding to double parameters are effectively cast to double.
- Otherwise, all arithmetic arguments corresponding to double parameters have type float.
これの2. で、整数型はdoubleにキャストされる、とある部分。
C++23でもありました。。。 拡張浮動小数点数型も考慮した文章になってるだけでした。
For each function with at least one parameter of type floating-point-type other than abs, the implementationalso provides additional overloads sufficient to ensure that, if every argument corresponding to a floating-pointtypeparameter has arithmetic type, then every such argument is effectively cast to the floating-point type withthe greatest floating-point conversion rank and greatest floating-point conversion subrank among the types of all such arguments, where arguments of integer type are considered to have the same floating-point conversionrank as double. If no such floating-point type with the greatest rank and subrank exists, then overloadresolution does not result in a usable candidate (12.2.1) from the overloads provided by the implementation.
<cmath>
のconstexpr
対応を進めているのですが、Integralのオーバーロードはもしかして削除されてますかね…。 どうなっているのかと経緯を調べます…。