在线文档教程
C++
应用 | Utilities

std::numeric_limits::denorm_min

STD::数字[医]限值::denorm[医]敏

static T denorm_min((until C++11)
static constexpr T denorm_min((since C++11)

返回最小正值亚正常值类型T,如果std::numeric_limits<T>::has_denorm!=std::denorm_absent,否则返回std::numeric_limits<T>::min().仅对浮点类型有意义.

返回值

Tstd::numeric_limits::denorm_min()
/* non-specialized */T(
boolfalse
char​0​
signed char​0​
unsigned char​0​
wchar_t​0​
char16_t​0​
char32_t​0​
short​0​
unsigned short​0​
int​0​
unsigned int​0​
long​0​
unsigned long​0​
long long​0​
unsigned long long​0​
float2-149 if std::numeric_limits<float>::is_iec559 == true
double2-1074 if std::numeric_limits<double>::is_iec559 == true
long double/* implementation-defined */

例外

(none)(until C++11)
noexcept specification: noexcept(since C++11)

证明了deorm的基本位结构。[医]最低28%%29。

二次

#include <cstdint> #include <limits> #include <cassert> int main() { // the smallest subnormal value has sign bit = 0, exponent = 0 // and only the least significant bit of the fraction is 1 uint32_t denorm_bits = 0x0001; float denorm_float = reinterpret_cast<float&>(denorm_bits assert(denorm_float == std::numeric_limits<float>::denorm_min() }

二次

另见

min staticreturns the smallest finite value of the given type (public static member function)
has_denorm staticidentifies the denormalization style used by the floating-point type (public static member constant)
lowest staticreturns the lowest finite value of the given type (public static member function)

© cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

http://en.cppreference.com/w/cpp/type/NUMERIC[医]极限/脱金属[医]敏