C++ 中基本数据类型的最大最小值
2013-01-14 21:12
381 查看
#include <limits> #include <iostream> using namespace std; int main () { cout << (std::numeric_limits<int>::max)() << endl; cout << (std::numeric_limits<unsigned>::max)() << endl; cout << (std::numeric_limits<long int>::max)() << endl; cout << "-----------------------------" << endl; cout << (std::numeric_limits<int>::min)() << endl; cout << (std::numeric_limits<unsigned>::min)() << endl; cout << (std::numeric_limits<long int>::min)() << endl; cout << "-----------------------------" << endl; cout << (std::numeric_limits<float>::max)() << endl; cout << (std::numeric_limits<float>::min)() << endl; return 0; }
注:本文参考:1、http://zhidao.baidu.com/question/23714860.html
2、http://zhidao.baidu.com/question/26430673.html
相关文章推荐
- c/c++ 基本数据类型最大值,最小值是多少?负数是怎样表示的。
- C/C++语言中的int等基本数据类型所能表示的最大值最小值
- C++中不同数据类型最大值最小值表示方法
- c++数据类型(整型/浮点型/字符串/数组/引用/结构体(内存对齐)/类(虚函数))定义、所占字节数、最大最小值
- KING_C#学习之各种基本数据类型的最大值最小值
- <转载>C++各数据类型最大最小值
- c++基本类型最大最小值
- C/C++ int、long、double、char等各种内置数据类型的表示范围(最大最小值)
- 【转】各种数据类型的取值范围 C/C++标准库中定义的各个类型最大值最小值limit.h
- C/C++——求下面数据类型的最大值和最小值: char, short, int, long, float, double, long double和numeric_limits使用
- C/C++基本数据类型
- CPU位数、操作系统位数、计算机字长、C/C++基本数据类型长度
- C++基础(二) 基本数据类型与数值表达式
- C++中基本数据类型字节数及取值范围
- C/C++中各种类型int、long、double、char表示范围(最大最小值)
- java中一些基本类型的长度和最大最小值
- java基本类型的最大最小值以及溢出测试
- C/C++基本数据类型 (转载)
- C/C++基本数据类型所占字节数
- C/C++中各种类型int、long、double、char表示范围(最大最小值)