命名空间
变体
操作

标准库头文件 <stdfloat> (C++23)

来自 cppreference.cn
< cpp‎ | header
 
 
标准库头文件
算法
<algorithm>
<numeric>
字符串
<cctype>
<cstring>
<cuchar> (C++11)
<cwchar>
<cwctype>
<string_view> (C++17)
<string>
文本处理
<clocale>
<codecvt> (C++11/17/26*)
<locale>
<regex> (C++11)
<text_encoding> (C++26)   
数值
<cfenv> (C++11)
<cmath>
<complex>
<linalg> (C++26)
<numbers> (C++20)
<random> (C++11)
<simd> (C++26)
<valarray>
时间
<chrono> (C++11)
<ctime>
C 兼容性
<ccomplex> (C++11/17/20*)
<ciso646> (直到 C++20)
<cstdalign> (C++11/17/20*)
<cstdbool> (C++11/17/20*)
<ctgmath> (C++11/17/20*)
 

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

目录

类型

分别具有精确 16、32、64 和 128 位宽度的二进制浮点类型
(typedef) [编辑]
(C++23)(可选)
精确具有 16 位的 brain 浮点类型
(typedef) [编辑]

[编辑] 注释

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

[编辑] 概要

namespace std {
  #if defined(__STDCPP_FLOAT16_T__)
    using float16_t  = /* implementation-defined */;
  #endif
  #if defined(__STDCPP_FLOAT32_T__)
    using float32_t  = /* implementation-defined */;
  #endif
  #if defined(__STDCPP_FLOAT64_T__)
    using float64_t  = /* implementation-defined */;
  #endif
  #if defined(__STDCPP_FLOAT128_T__)
    using float128_t = /* implementation-defined */;
  #endif
  #if defined(__STDCPP_BFLOAT16_T__)
    using bfloat16_t = /* implementation-defined */;
  #endif
}

[编辑] 参考文献

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