int,long long,double,float等的范围(和精度)
2017-10-31 07:04
429 查看
名称 全称类型说明符 缩写类型说明符 位数 范围
整型 int int 16位 -32768至+32767
无符号整型 unsigned int unsigned 16位 0 至 65,535
短整型 short int short 16位 -32768至+32767
无符号短整型 unsigned short int unsigned short 16位 0 至 65,535
长整型 long int long 32位 -2,147,483,648 至 2,147,483,647( -2^63 ~ 2^63-1)
无符号长整型 unsigned long int unsigned long 32位 0至4,294,967,295
double 和 float 的区别是double精度高,有效数字16位,float精度7位。但double消耗内存是float的两倍,double的运算速度比float慢得多,在不确定的情况下还是尽量用double以保持正确性.
类型 比特数 有效数字 数值范围
float 32 6-7 -3.4*10(-38)~3.4*10(38)
double 64 15-16 -1.7*10(-308)~1.7*10(308)
long double 128 18-19 -1.2*10(-4932)~1.2*10(4932)
(以上内容来源于“百度知道”)
整型 int int 16位 -32768至+32767
无符号整型 unsigned int unsigned 16位 0 至 65,535
短整型 short int short 16位 -32768至+32767
无符号短整型 unsigned short int unsigned short 16位 0 至 65,535
长整型 long int long 32位 -2,147,483,648 至 2,147,483,647( -2^63 ~ 2^63-1)
无符号长整型 unsigned long int unsigned long 32位 0至4,294,967,295
double 和 float 的区别是double精度高,有效数字16位,float精度7位。但double消耗内存是float的两倍,double的运算速度比float慢得多,在不确定的情况下还是尽量用double以保持正确性.
类型 比特数 有效数字 数值范围
float 32 6-7 -3.4*10(-38)~3.4*10(38)
double 64 15-16 -1.7*10(-308)~1.7*10(308)
long double 128 18-19 -1.2*10(-4932)~1.2*10(4932)
(以上内容来源于“百度知道”)
相关文章推荐
- java中short、int、long、float、double取值范围
- int long longlong float double类型数据的范围
- java int short long float double精度最大值整理
- 关于C和C++中的基本数据类型int、long、long long、float、double、char、string的大小及表示范围
- 关于C和C++中的基本数据类型int、long、long long、float、double、char、string的大小及表示范围
- int,float,long,double取值范围,内存泄露
- Java笔记19 - java中short、int、long、float、double取值范围
- int、long、longlong、float、double、long double的范围
- java基础之面试篇三---int,float,long,double取值范围,内存泄露
- java中short、int、long、float、double取值范围
- int,long,long long,float,double范围
- java中byte、short、int、long、float、double类型的取值范围
- int,long,long,double,float的范围
- int、long、longlong、float、double、long double的范围
- (JAVA & C)数据类型取值范围——short int long float double等
- java中int,float,long,double取值范围,内存泄露
- C++ int,float,double,long表示范围
- java中int,float,long,double取值范围,内存泄露
- java中short、int、long、float、double取值范围
- java里short,int,long,float,double范围及可写位数