位置:首頁 > 軟件操作教程 > 編程開發(fā) > C# > 問題詳情

常用的數(shù)據(jù)類型

提問人:劉冬梅發(fā)布時(shí)間:2020-10-10

類型

別名

有無符號(hào)

占據(jù)字節(jié)數(shù)

允許值的范圍

sbyte

System.Sbyte

1

 -128 到 127

 short

System.Int16

2

 -32768 32767

 int

System.Int32

4

 -2147483648 到 2147483647

 long

System.Int64

8

 -9223372036854775808 到 9223372036854775807

 byte

System.Byte

1

 到 255

ushort

System.Uint16

2

 到 65535

 uint

ystem.UInt32

4

 到 4294967295

 unlong

ystem.Uint64

8

 18446744073709551615

 float

System.Single

4

 可能值從 ±1.5 x 10-45 到 ±3.4 x 1038 ,小數(shù)點(diǎn)后7位有效數(shù)字

double

System.Double

8

 可能值從 ±5.0 x 10-324 to ±1.7 x 10308 小數(shù)點(diǎn)后1516位有效數(shù)字

decimal

System.Decimal

16

可能值從 ±1.0 x 10-28  ±7.9 x 1028 小數(shù)點(diǎn)后2829位有效數(shù)字

char

System.Char

N/A

2

 任何16Unicode字符

bool

System.Boolean

N/A

1

 true 或者false

繼續(xù)查找其他問題的答案?

相關(guān)視頻回答
回復(fù)(0)
返回頂部