首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::numeric_limits::denorm_min

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().仅对浮点类型有意义.

返回值

T

std::numeric_limits<T>::denorm_min()

/* non-specialized */

T();

bool

false

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​

float

2-149 if std::numeric_limits<float>::is_iec559 == true

double

2-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。

二次

代码语言:javascript
复制
#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 static

returns the smallest finite value of the given type (public static member function)

has_denorm static

identifies the denormalization style used by the floating-point type (public static member constant)

lowest static

returns the lowest finite value of the given type (public static member function)

代码语言:txt
复制
 © cppreference.com

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

扫码关注腾讯云开发者

领取腾讯云代金券