- limits[meta header]
- std[meta namespace]
- numeric_limits[meta class]
- variable[meta id-type]
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;
}
- is_iec559[color ff0000]
float : true
double : true