数值极限
来源:互联网 发布:怎样发淘宝链接网址 编辑:程序博客网 时间:2024/05/16 17:57
#include<iostream>
#include<limits>
#include<string>
using namespace std;
int main()
{
cout << boolalpha;
cout << "max(short):" << numeric_limits<short>::max() << endl;
cout << "max(int):" << numeric_limits<int>::max() << endl;
cout << "max(long):" << numeric_limits<long>::max() << endl;
cout << endl;
cout << "max(float):" << numeric_limits<float>::max() << endl;
cout << "max(double):" << numeric_limits<double>::max() << endl;
cout << "max(long douuble):" << numeric_limits<long double>::max() << endl;
cout << endl;
cout << "is_signed(char)" << numeric_limits<char>::is_signed << endl;
cout << endl;
cout << "is_specialized(string):" << numeric_limits<string>::is_specialized << endl;
getchar();
getchar();
#include<limits>
#include<string>
using namespace std;
int main()
{
cout << boolalpha;
cout << "max(short):" << numeric_limits<short>::max() << endl;
cout << "max(int):" << numeric_limits<int>::max() << endl;
cout << "max(long):" << numeric_limits<long>::max() << endl;
cout << endl;
cout << "max(float):" << numeric_limits<float>::max() << endl;
cout << "max(double):" << numeric_limits<double>::max() << endl;
cout << "max(long douuble):" << numeric_limits<long double>::max() << endl;
cout << endl;
cout << "is_signed(char)" << numeric_limits<char>::is_signed << endl;
cout << endl;
cout << "is_specialized(string):" << numeric_limits<string>::is_specialized << endl;
getchar();
getchar();
}
vs2013中的运行结果如下:
max(short):32767
max(int):2147483647
max(long):2147483647
max(float):3.40282e+038
max(double):1.79769e+308
max(long douuble):1.79769e+308
is_signed(char)true
is_specialized(string):false
0 0
- 数值极限
- 数值极限numeric_limits
- 数值极限numeric_limits
- 数值极限numeric_limits
- c++ 判断数值极限
- STL 数值极限 辅助函数 <cstddef ><cstdlib>
- C++标准库的数值极限numeric_limits
- C++标准库的数值极限numeric_limits
- 九、 通用工具 ----数值的极限(Numeric Limit)
- GB/T 8170-2008 数值修约规则与极限数值的表示和判定
- 极限
- 极限
- 极限
- 极限
- 数值
- 数值
- 数值
- 数值
- 已经定义好的select,动态添加option
- Linux 标准目录结构
- 2035 人见人爱A^B
- 分享一下关于上一份工作离职的点点滴滴,奉劝大家不要太冲动
- jdk1.5新特性:自动装箱
- 数值极限
- 字符数组的初始化和赋值
- MIPI video mode 和 command mode 的区别
- Android中<meta-data>的使用
- UVA 10413 - Crazy Savages(数论)
- 安佑集团应用FineReport建云端平台报表系统
- 数字转中文表示
- LinkedList中将对象按照某一属性排序
- MySQL C/C++ API 问题汇总