Namespaces
Variants

Standard library header <stdfloat> (C++23)

From cppreference.net
Standard library headers

此头文件是 类型支持 库的组成部分,提供 固定宽度浮点类型

目录

类型

宽度分别为16、32、64和128位的二进制浮点类型
(typedef)
(C++23) (optional)
精确为16位的脑浮点类型
(typedef)

注释

固定宽度浮点类型必须是扩展浮点类型的别名(而非 float / double / long double ),因此不能直接替代标准浮点类型。

概要

namespace std {
  #if defined(__STDCPP_FLOAT16_T__)
    using float16_t  = /* 由实现定义 */;
  #endif
  #if defined(__STDCPP_FLOAT32_T__)
    using float32_t  = /* 由实现定义 */;
  #endif
  #if defined(__STDCPP_FLOAT64_T__)
    using float64_t  = /* 由实现定义 */;
  #endif
  #if defined(__STDCPP_FLOAT128_T__)
    using float128_t = /* 由实现定义 */;
  #endif
  #if defined(__STDCPP_BFLOAT16_T__)
    using bfloat16_t = /* 由实现定义 */;
  #endif
}

参考文献

  • C++23 标准 (ISO/IEC 14882:2024):
  • 17.5 头文件 <stdfloat> 概要 [stdfloat.syn]