数据类型

一、C/C++(预编译器、机器有关)

分类: 整型(int) 、浮点型(float) 、字符型(char) 、指针型(*) 、无值型(void)以及自定义类型(struct   union)

(1)整型

type notes
signed short int 简写short或int,字长2 字节,范围是-32768~32767 
signed long int 简写long,字长4 字节,范围是-2147483648~2147483647 
unsigned short int 简写unsigned int,字长2 字节,范围是0~65535 
unsigned long int 简写unsigned long,字长4 字节,范围是0~4294967295 

(2) 浮点型

typenote
float4byte.32bit,3.4x10-38E~3.4x10+38E
double8byte ,64bit,1.7x10-308E~1.7x10+308E 
long double 16byte,128bit
(3)字符型

char 通常占一个字节

unsigned char

转换规则:(char 、short)->int  -> unsigned -> long -> double <- float

二、Java

(1)整数类──byte, short, int, long

 8 bits         byte          -2 ^7... 2 ^7 -1 
16 bits        short         -2 ^15 ... 2^ 15-1 
 32 bit         int           -2 ^31 .. 2 ^31 -1 
 64 bits        long          -2^ 63... 2 ^63-1 


(2)char   16-bit Unicode

(3)浮点型

  32 bits                   float  
  64 bits                   double 

(4)boolean
三 、javascript无类型

(1)Number型 即可表示32bit的整数,又可以表示64bit的浮点数

对应于32bit  整型

>>带符号的右移,符号位不参与移动

>>>无符号右移,符号位参与移动

Number.MIN_VALUE~Number.MAX_VALUE

5e-324~1.7976931348623157e+308

(2)String类型16bit Unicode 串




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值