|
MSTL 1.4.0
A Modern C++ Library with extended functionality, web components, and utility libraries
|
浮点数特性检查和特殊值判断 更多...
函数 | |
| template<typename T, enable_if_t< is_floating_point_v< T >, int > = 0> | |
| MSTL_CONST_FUNCTION constexpr bool | signbit (const T x) noexcept |
| 获取浮点数的符号位 | |
| template<typename T, enable_if_t< is_floating_point_v< T >, int > = 0> | |
| MSTL_CONST_FUNCTION constexpr bool | is_nan (const T x) noexcept |
| 检查浮点数是否为NaN | |
| template<typename T, enable_if_t< is_floating_point_v< T >, int > = 0> | |
| MSTL_CONST_FUNCTION constexpr bool | is_pos_infinity (const T x) noexcept |
| 检查浮点数是否为正无穷大 | |
| template<typename T, enable_if_t< is_floating_point_v< T >, int > = 0> | |
| MSTL_CONST_FUNCTION constexpr bool | is_neg_infinity (const T x) noexcept |
| 检查浮点数是否为负无穷大 | |
| template<typename T, enable_if_t< is_floating_point_v< T >, int > = 0> | |
| MSTL_CONST_FUNCTION constexpr bool | is_infinity (const T x) noexcept |
| 检查浮点数是否为无穷大 | |
| template<typename T, enable_if_t< is_floating_point_v< T >, int > = 0> | |
| MSTL_CONST_FUNCTION constexpr bool | is_finite (const T x) noexcept |
| 检查浮点数是否为有限值 | |
| template<typename T, enable_if_t< is_floating_point_v< T >, int > = 0> | |
| MSTL_CONST_FUNCTION constexpr bool | is_normal (const T x) noexcept |
| 检查浮点数是否为正规数 | |
| template<typename T, enable_if_t< is_floating_point_v< T >, int > = 0> | |
| MSTL_CONST_FUNCTION constexpr bool | is_subnormal (const T x) noexcept |
| 检查浮点数是否为次正规数 | |
| template<typename T, enable_if_t< is_floating_point_v< T >, int > = 0> | |
| MSTL_CONST_FUNCTION constexpr bool | is_positive (const T x) noexcept |
| 检查浮点数是否为正数 | |
| template<typename T, enable_if_t< is_floating_point_v< T >, int > = 0> | |
| MSTL_CONST_FUNCTION constexpr bool | is_negative (const T x) noexcept |
| 检查浮点数是否为负数 | |
浮点数特性检查和特殊值判断
|
constexprnoexcept |
检查浮点数是否为有限值
| T | 浮点数类型 |
| x | 待检查的浮点数 |
有限值包括:正常数、负零、正零、次正规数、正规数。
在文件 numeric_types.hpp 第 98 行定义.
引用了 _MSTL, is_infinity() , 以及 is_nan().
被这些函数引用 is_normal() , 以及 is_subnormal().
|
constexprnoexcept |
检查浮点数是否为无穷大
| T | 浮点数类型 |
| x | 待检查的浮点数 |
在文件 numeric_types.hpp 第 85 行定义.
引用了 _MSTL, is_neg_infinity() , 以及 is_pos_infinity().
被这些函数引用 is_finite().
|
constexprnoexcept |
检查浮点数是否为NaN
| T | 浮点数类型 |
| x | 待检查的浮点数 |
NaN的特性:NaN != NaN 总是成立。
在文件 numeric_types.hpp 第 51 行定义.
被这些函数引用 is_finite().
|
constexprnoexcept |
检查浮点数是否为负无穷大
| T | 浮点数类型 |
| x | 待检查的浮点数 |
在文件 numeric_types.hpp 第 73 行定义.
引用了 numeric_traits< T, Dummy >::infinity().
被这些函数引用 is_infinity().
|
constexprnoexcept |
检查浮点数是否为负数
| T | 浮点数类型 |
| x | 待检查的浮点数 |
包括:负正规数、负次正规数、负无穷大、负零。
在文件 numeric_types.hpp 第 160 行定义.
|
constexprnoexcept |
检查浮点数是否为正规数
| T | 浮点数类型 |
| x | 待检查的浮点数 |
正规数:绝对值大于等于最小正正规数的有限非零浮点数。 不包括:零、次正规数、无穷大、NaN。
在文件 numeric_types.hpp 第 112 行定义.
引用了 _MSTL, absolute(), is_finite() , 以及 numeric_traits< T, Dummy >::min().
|
constexprnoexcept |
检查浮点数是否为正无穷大
| T | 浮点数类型 |
| x | 待检查的浮点数 |
在文件 numeric_types.hpp 第 62 行定义.
引用了 numeric_traits< T, Dummy >::infinity().
被这些函数引用 is_infinity().
|
constexprnoexcept |
检查浮点数是否为正数
| T | 浮点数类型 |
| x | 待检查的浮点数 |
包括:正正规数、正次正规数、正无穷大、正零。
在文件 numeric_types.hpp 第 145 行定义.
|
constexprnoexcept |
检查浮点数是否为次正规数
| T | 浮点数类型 |
| x | 待检查的浮点数 |
次正规数(非正规数):绝对值小于最小正正规数的非零浮点数。 用于表示接近零的非常小的数值。
在文件 numeric_types.hpp 第 128 行定义.
引用了 _MSTL, absolute(), is_finite() , 以及 numeric_traits< T, Dummy >::min().
|
constexprnoexcept |
获取浮点数的符号位
| T | 浮点数类型 |
| x | 待检查的浮点数 |
通过检查浮点数的二进制表示中的符号位来判断其符号。
在文件 numeric_types.hpp 第 33 行定义.
被这些函数引用 is_negative() , 以及 is_positive().