---------- 20190125 /* C# Primitive Datatypes, 整數位數備忘: ----- ----- ---------------------------- ------------------------- -------------- bytes C# Min Max 完整有效10進位 Significant digits ----- ----- ---------------------------- ------------------------- -------------- 1 byte 0 255 2 1 sbyte -128 127 2 ----- ----- ---------------------------- ------------------------- -------------- 2 short -2^15 2^15-1 4 2 short -32,768 32,767 4 2 ushort 0 65,535 4 2 char ----- ----- ---------------------------- ------------------------- -------------- 4 int -2^31 2^31-1 9 4 int -2,147,483,648 2,147,483,647 9 4 uint 0 4 billion 9 4 float 7 4 object 4 string length up to 2 billion bytes. ----- ----- ---------------------------- ------------------------- -------------- 8 long -2^63 2^63-1 18 8 long -9,223,372,036,854,775,808, 9,223,372,036,854,775,807 18 8 ulong 0, 18 quintillion 18 8 double 15 8 DateTime 1/1/01 0:00:00 9999/12/31 12:59:59 ----- ----- ---------------------------- ------------------------- -------------- 24 decimal 28 or 29 ----- ----- ---------------------------- ------------------------- -------------- 8 DateTime yyyyMMdd 8 yyyyMMddHHmm 14 yyyyMMddHHmmfff 17 ticks (datatype=long, 每100奈秒為一個ticks, 從0001-01-01 00:00:00開始起算) A single tick represents one hundred nanoseconds or one ten-millionth of a second. There are 10,000 ticks in a millisecond, or 10 million ticks in a second. The value of this property represents the number of 100-nanosecond intervals that have elapsed since 12:00:00 midnight, January 1, 0001 (0:00:00 UTC on January 1, 0001, in the Gregorian calendar), which represents DateTime.MinValue. It does not include the number of ticks that are attributable to leap seconds. ----- ----- ---------------------------- ------------------------- -------------- */