static const bool is_iec559; // (1) C++03
static constexpr bool is_iec559; // (1) C++11
概要
浮動小数点数型において、型TがIEC 559 (IEEE 754) に準拠しているかを判定する。
備考
- C++23 :
float16_t、float32_t、float64_t、float128_tが存在する場合、この値はtrueとなる
例
#include <iostream>
#include <limits>
int main()
{
constexpr bool f = std::numeric_limits<float>::is_iec559;
constexpr bool d = std::numeric_limits<double>::is_iec559;
std::cout << std::boolalpha;
std::cout << "float : " << f << std::endl;
std::cout << "double : " << d << std::endl;
}
出力例
float : true
double : true