当前位置: 首页 > news >正文

网站网页设计哪个好免费论坛建站系统

网站网页设计哪个好,免费论坛建站系统,广州白云机场网站建设,七牛镜像存储 wordpress数值极限 std::numeric_limits 定义于头文件 <limits> 定义于头文件 <limits> template< class T > class numeric_limits; numeric_limits 类模板提供查询各种算术类型属性的标准化方式&#xff08;例如 int 类型的最大可能值是 std::numeric_limits&l…

数值极限

std::numeric_limits

定义于头文件 <limits>

定义于头文件 <limits>

template< class T > class numeric_limits;

numeric_limits 类模板提供查询各种算术类型属性的标准化方式(例如 int 类型的最大可能值是 std::numeric_limits<int>::max() )。
 

10 的该数次幂是合法正规浮点值的最小负数

std::numeric_limits<T>::min_exponent10

static const int min_exponent10;

(C++11 前)

static constexpr int min_exponent10;

(C++11 起)

std::numeric_limits<T>::min_exponent10 的值是满足 10n是浮点类型 T 的合法正规值的最低负数 n

标准特化

Tstd::numeric_limits<T>::min_exponent10 的值
/* non-specialized */​0​
bool​0​
char​0​
signed char​0​
unsigned char​0​
wchar_t​0​
char8_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​
floatFLT_MIN_10_EXP
doubleDBL_MIN_10_EXP
long doubleLDBL_MIN_10_EXP

调用示例

#include <iostream>
#include <string>
#include <limits>
#include <cstdint>
#include <cfloat>struct SName
{
};//偏特化
struct SPartSpec
{
};namespace std
{
template<>
struct numeric_limits<SPartSpec>
{static _GLIBCXX_USE_CONSTEXPR bool is_specialized   = true;static _GLIBCXX_USE_CONSTEXPR bool is_signed        = true;static _GLIBCXX_USE_CONSTEXPR bool is_integer       = true;static _GLIBCXX_USE_CONSTEXPR bool is_exact         = true;static _GLIBCXX_USE_CONSTEXPR bool has_infinity     = true;static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN    = true;static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = true;static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm     = denorm_present;static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss  = true;static _GLIBCXX_USE_CONSTEXPR float_round_style round_style     = round_toward_neg_infinity;static _GLIBCXX_USE_CONSTEXPR bool is_iec559        = true;static _GLIBCXX_USE_CONSTEXPR bool is_bounded       = true;static _GLIBCXX_USE_CONSTEXPR bool is_modulo        = true;static _GLIBCXX_USE_CONSTEXPR int  digits           = CHAR_BIT;static _GLIBCXX_USE_CONSTEXPR int  digits10         = CHAR_BIT;static _GLIBCXX_USE_CONSTEXPR int  max_digits10     = DECIMAL_DIG;static _GLIBCXX_USE_CONSTEXPR int  radix            = FLT_RADIX;static _GLIBCXX_USE_CONSTEXPR int  min_exponent     = FLT_MIN_EXP;static _GLIBCXX_USE_CONSTEXPR int  min_exponent10   = FLT_MIN_10_EXP;
};
}int main()
{std::cout << std::boolalpha;std::cout << "std::numeric_limits<bool>::min_exponent10:                 "<< std::numeric_limits<bool>::min_exponent10 << std::endl;std::cout << "std::numeric_limits<char>::min_exponent10:                 "<< std::numeric_limits<char>::min_exponent10 << std::endl;std::cout << "std::numeric_limits<signed char>::min_exponent10:          "<< std::numeric_limits<signed char>::min_exponent10 << std::endl;std::cout << "std::numeric_limits<unsigned char>::min_exponent10:        "<< std::numeric_limits<unsigned char>::min_exponent10 << std::endl;std::cout << "std::numeric_limits<wchar_t>::min_exponent10:              "<< std::numeric_limits<wchar_t>::min_exponent10 << std::endl;std::cout << "std::numeric_limits<char16_t>::min_exponent10:             "<< std::numeric_limits<char16_t>::min_exponent10 << std::endl;std::cout << "std::numeric_limits<char32_t>::min_exponent10:             "<< std::numeric_limits<char32_t>::min_exponent10 << std::endl;std::cout << "std::numeric_limits<short>::min_exponent10:                "<< std::numeric_limits<short>::min_exponent10 << std::endl;std::cout << "std::numeric_limits<unsigned short>::min_exponent10:       "<< std::numeric_limits<unsigned short>::min_exponent10 << std::endl;std::cout << "std::numeric_limits<int>::min_exponent10:                  "<< std::numeric_limits<int>::min_exponent10 << std::endl;std::cout << "std::numeric_limits<unsigned int>::min_exponent10:         "<< std::numeric_limits<unsigned int>::min_exponent10 << std::endl;std::cout << "std::numeric_limits<long>::min_exponent10:                 "<< std::numeric_limits<long>::min_exponent10 << std::endl;std::cout << "std::numeric_limits<unsigned long>::min_exponent10:        "<< std::numeric_limits<unsigned long>::min_exponent10 << std::endl;std::cout << "std::numeric_limits<long long>::min_exponent10:            "<< std::numeric_limits<long long>::min_exponent10 << std::endl;std::cout << "std::numeric_limits<unsigned long long>::min_exponent10:   "<< std::numeric_limits<unsigned long long>::min_exponent10 << std::endl;std::cout << "std::numeric_limits<float>::min_exponent10:                "<< std::numeric_limits<float>::min_exponent10 << std::endl;std::cout << "std::numeric_limits<double>::min_exponent10:               "<< std::numeric_limits<double>::min_exponent10 << std::endl;std::cout << "std::numeric_limits<long double>::min_exponent10:          "<< std::numeric_limits<long double>::min_exponent10 << std::endl;std::cout << "std::numeric_limits<std::string>::min_exponent10:          "<< std::numeric_limits<std::string>::min_exponent10 << std::endl;std::cout << "std::numeric_limits<SName>::min_exponent10:                "<< std::numeric_limits<SName>::min_exponent10 << std::endl;std::cout << "std::numeric_limits<SPartSpec>::min_exponent10:            "<< std::numeric_limits<SPartSpec>::min_exponent10 << std::endl;return 0;
}

输出

底的该数次幂是合法有限浮点值的最大整数加一

std::numeric_limits<T>::max_exponent

static const int max_exponent;

(C++11 前)

static constexpr int max_exponent;

(C++11 起)

std::numeric_limits<T>::max_exponent 的值是满足 rn-1是浮点类型 T 的可表示有限值最大正整数 n ,其中 r 是 std::numeric_limits<T>::radix 。

标准特化

Tstd::numeric_limits<T>::max_exponent 的值
/* non-specialized */​0​
bool​0​
char​0​
signed char​0​
unsigned char​0​
wchar_t​0​
char8_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​
floatFLT_MAX_EXP
doubleDBL_MAX_EXP
long doubleLDBL_MAX_EXP

调用示例

#include <iostream>
#include <string>
#include <limits>
#include <cstdint>
#include <cfloat>struct SName
{
};//偏特化
struct SPartSpec
{
};namespace std
{
template<>
struct numeric_limits<SPartSpec>
{static _GLIBCXX_USE_CONSTEXPR bool is_specialized   = true;static _GLIBCXX_USE_CONSTEXPR bool is_signed        = true;static _GLIBCXX_USE_CONSTEXPR bool is_integer       = true;static _GLIBCXX_USE_CONSTEXPR bool is_exact         = true;static _GLIBCXX_USE_CONSTEXPR bool has_infinity     = true;static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN    = true;static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = true;static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm     = denorm_present;static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss  = true;static _GLIBCXX_USE_CONSTEXPR float_round_style round_style     = round_toward_neg_infinity;static _GLIBCXX_USE_CONSTEXPR bool is_iec559        = true;static _GLIBCXX_USE_CONSTEXPR bool is_bounded       = true;static _GLIBCXX_USE_CONSTEXPR bool is_modulo        = true;static _GLIBCXX_USE_CONSTEXPR int  digits           = CHAR_BIT;static _GLIBCXX_USE_CONSTEXPR int  digits10         = CHAR_BIT;static _GLIBCXX_USE_CONSTEXPR int  max_digits10     = DECIMAL_DIG;static _GLIBCXX_USE_CONSTEXPR int  radix            = FLT_RADIX;static _GLIBCXX_USE_CONSTEXPR int  min_exponent     = FLT_MIN_EXP;static _GLIBCXX_USE_CONSTEXPR int  min_exponent10   = FLT_MIN_10_EXP;static _GLIBCXX_USE_CONSTEXPR int  max_exponent     = FLT_MAX_EXP;
};
}int main()
{std::cout << std::boolalpha;std::cout << "std::numeric_limits<bool>::max_exponent:                 "<< std::numeric_limits<bool>::max_exponent << std::endl;std::cout << "std::numeric_limits<char>::max_exponent:                 "<< std::numeric_limits<char>::max_exponent << std::endl;std::cout << "std::numeric_limits<signed char>::max_exponent:          "<< std::numeric_limits<signed char>::max_exponent << std::endl;std::cout << "std::numeric_limits<unsigned char>::max_exponent:        "<< std::numeric_limits<unsigned char>::max_exponent << std::endl;std::cout << "std::numeric_limits<wchar_t>::max_exponent:              "<< std::numeric_limits<wchar_t>::max_exponent << std::endl;std::cout << "std::numeric_limits<char16_t>::max_exponent:             "<< std::numeric_limits<char16_t>::max_exponent << std::endl;std::cout << "std::numeric_limits<char32_t>::max_exponent:             "<< std::numeric_limits<char32_t>::max_exponent << std::endl;std::cout << "std::numeric_limits<short>::max_exponent:                "<< std::numeric_limits<short>::max_exponent << std::endl;std::cout << "std::numeric_limits<unsigned short>::max_exponent:       "<< std::numeric_limits<unsigned short>::max_exponent << std::endl;std::cout << "std::numeric_limits<int>::max_exponent:                  "<< std::numeric_limits<int>::max_exponent << std::endl;std::cout << "std::numeric_limits<unsigned int>::max_exponent:         "<< std::numeric_limits<unsigned int>::max_exponent << std::endl;std::cout << "std::numeric_limits<long>::max_exponent:                 "<< std::numeric_limits<long>::max_exponent << std::endl;std::cout << "std::numeric_limits<unsigned long>::max_exponent:        "<< std::numeric_limits<unsigned long>::max_exponent << std::endl;std::cout << "std::numeric_limits<long long>::max_exponent:            "<< std::numeric_limits<long long>::max_exponent << std::endl;std::cout << "std::numeric_limits<unsigned long long>::max_exponent:   "<< std::numeric_limits<unsigned long long>::max_exponent << std::endl;std::cout << "std::numeric_limits<float>::max_exponent:                "<< std::numeric_limits<float>::max_exponent << std::endl;std::cout << "std::numeric_limits<double>::max_exponent:               "<< std::numeric_limits<double>::max_exponent << std::endl;std::cout << "std::numeric_limits<long double>::max_exponent:          "<< std::numeric_limits<long double>::max_exponent << std::endl;std::cout << "std::numeric_limits<std::string>::max_exponent:          "<< std::numeric_limits<std::string>::max_exponent << std::endl;std::cout << "std::numeric_limits<SName>::max_exponent:                "<< std::numeric_limits<SName>::max_exponent << std::endl;std::cout << "std::numeric_limits<SPartSpec>::max_exponent:            "<< std::numeric_limits<SPartSpec>::max_exponent << std::endl;return 0;
}

 输出

10 的该数次幂是合法有限浮点值的最大整数

std::numeric_limits<T>::max_exponent10

std::numeric_limits<T>::max_exponent10 的值是满足 10n是浮点类型 T 的可表示有限值的最大正整数 n

标准特化

Tstd::numeric_limits<T>::max_exponent10 的值
/* non-specialized */​0​
bool​0​
char​0​
signed char​0​
unsigned char​0​
wchar_t​0​
char8_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​
floatFLT_MAX_10_EXP
doubleDBL_MAX_10_EXP
long doubleLDBL_MAX_10_EXP

调用示例

#include <iostream>
#include <string>
#include <limits>
#include <cstdint>
#include <cfloat>struct SName
{
};//偏特化
struct SPartSpec
{
};namespace std
{
template<>
struct numeric_limits<SPartSpec>
{static _GLIBCXX_USE_CONSTEXPR bool is_specialized   = true;static _GLIBCXX_USE_CONSTEXPR bool is_signed        = true;static _GLIBCXX_USE_CONSTEXPR bool is_integer       = true;static _GLIBCXX_USE_CONSTEXPR bool is_exact         = true;static _GLIBCXX_USE_CONSTEXPR bool has_infinity     = true;static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN    = true;static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = true;static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm     = denorm_present;static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss  = true;static _GLIBCXX_USE_CONSTEXPR float_round_style round_style     = round_toward_neg_infinity;static _GLIBCXX_USE_CONSTEXPR bool is_iec559        = true;static _GLIBCXX_USE_CONSTEXPR bool is_bounded       = true;static _GLIBCXX_USE_CONSTEXPR bool is_modulo        = true;static _GLIBCXX_USE_CONSTEXPR int  digits           = CHAR_BIT;static _GLIBCXX_USE_CONSTEXPR int  digits10         = CHAR_BIT;static _GLIBCXX_USE_CONSTEXPR int  max_digits10     = DECIMAL_DIG;static _GLIBCXX_USE_CONSTEXPR int  radix            = FLT_RADIX;static _GLIBCXX_USE_CONSTEXPR int  min_exponent     = FLT_MIN_EXP;static _GLIBCXX_USE_CONSTEXPR int  min_exponent10   = FLT_MIN_10_EXP;static _GLIBCXX_USE_CONSTEXPR int  max_exponent     = FLT_MAX_EXP;static _GLIBCXX_USE_CONSTEXPR int  max_exponent10   = FLT_MAX_EXP;
};
}int main()
{std::cout << std::boolalpha;std::cout << "std::numeric_limits<bool>::max_exponent10:                 "<< std::numeric_limits<bool>::max_exponent10 << std::endl;std::cout << "std::numeric_limits<char>::max_exponent10:                 "<< std::numeric_limits<char>::max_exponent10 << std::endl;std::cout << "std::numeric_limits<signed char>::max_exponent10:          "<< std::numeric_limits<signed char>::max_exponent10 << std::endl;std::cout << "std::numeric_limits<unsigned char>::max_exponent10:        "<< std::numeric_limits<unsigned char>::max_exponent10 << std::endl;std::cout << "std::numeric_limits<wchar_t>::max_exponent10:              "<< std::numeric_limits<wchar_t>::max_exponent10 << std::endl;std::cout << "std::numeric_limits<char16_t>::max_exponent10:             "<< std::numeric_limits<char16_t>::max_exponent10 << std::endl;std::cout << "std::numeric_limits<char32_t>::max_exponent10:             "<< std::numeric_limits<char32_t>::max_exponent10 << std::endl;std::cout << "std::numeric_limits<short>::max_exponent10:                "<< std::numeric_limits<short>::max_exponent10 << std::endl;std::cout << "std::numeric_limits<unsigned short>::max_exponent10:       "<< std::numeric_limits<unsigned short>::max_exponent10 << std::endl;std::cout << "std::numeric_limits<int>::max_exponent10:                  "<< std::numeric_limits<int>::max_exponent10 << std::endl;std::cout << "std::numeric_limits<unsigned int>::max_exponent10:         "<< std::numeric_limits<unsigned int>::max_exponent10 << std::endl;std::cout << "std::numeric_limits<long>::max_exponent10:                 "<< std::numeric_limits<long>::max_exponent10 << std::endl;std::cout << "std::numeric_limits<unsigned long>::max_exponent10:        "<< std::numeric_limits<unsigned long>::max_exponent10 << std::endl;std::cout << "std::numeric_limits<long long>::max_exponent10:            "<< std::numeric_limits<long long>::max_exponent10 << std::endl;std::cout << "std::numeric_limits<unsigned long long>::max_exponent10:   "<< std::numeric_limits<unsigned long long>::max_exponent10 << std::endl;std::cout << "std::numeric_limits<float>::max_exponent10:                "<< std::numeric_limits<float>::max_exponent10 << std::endl;std::cout << "std::numeric_limits<double>::max_exponent10:               "<< std::numeric_limits<double>::max_exponent10 << std::endl;std::cout << "std::numeric_limits<long double>::max_exponent10:          "<< std::numeric_limits<long double>::max_exponent10 << std::endl;std::cout << "std::numeric_limits<std::string>::max_exponent10:          "<< std::numeric_limits<std::string>::max_exponent10 << std::endl;std::cout << "std::numeric_limits<SName>::max_exponent10:                "<< std::numeric_limits<SName>::max_exponent10 << std::endl;std::cout << "std::numeric_limits<SPartSpec>::max_exponent10:            "<< std::numeric_limits<SPartSpec>::max_exponent10 << std::endl;return 0;
}

输出

http://www.yidumall.com/news/78205.html

相关文章:

  • 做网站每天更新两篇文章哪里有正规的电商培训班
  • 福州网站怎么做的种子搜索器
  • vue做的个人网站今日资讯最新消息
  • 网站怎么盈利的给大家科普一下b站推广网站
  • 网上学编程哪个培训班最好河北百度seo点击软件
  • 国外网站都不能上怎么做跨境电商百度推广登录官网入口
  • 杭州营销型网站建设便民信息微信平台推广
  • 搜索引擎优化的主要内容西安百度推广优化公司
  • 重庆网站有哪些绍兴seo优化
  • 林州网站制作神马移动排名优化
  • 金山做网站公司磁力吧ciliba
  • 建设b2b2c网站报告网络广告投放
  • 金华网站建设建设设计网站国家认可的教育培训机构
  • 如何给网站做seo优化东莞网络优化排名
  • 知名做网站竞价排名
  • wordpress仿喜马拉雅网络推广关键词优化公司
  • 怎样设计网站版面长沙网站推广
  • 做网站的公司叫什么谷歌浏览器官方app下载
  • 用wgert 做网站检测知名的搜索引擎优化
  • app定制网站建设应有尽有搜索引擎站长平台
  • 北京中高端网站建设百度官方入口
  • 西安企业网站建设百度人工客服电话是多少
  • 石碣镇网站建设公司排名优化推广
  • 摄影网站设计重庆网页优化seo公司
  • 祥安阁风水网是哪个公司做的网站公司网站如何制作设计
  • 广东哪里网站建设seo站内优化站外优化
  • 域名注册网站源码seo方法培训
  • 免费的php网站模板今天国际新闻大事
  • 教育类app开发价格表深圳搜索排名优化
  • 赣州深科网站建设外贸网络推广经验