第三节 变量(二)

int 型变量的取值范围。

int型占用4个字节 32位。最高位为符号位。 0表示“正数”,1表示“负数”

取值范围为。-2的31次幂~2的31次幂减1;

short型:对于较小整数用。占用2个字节。

long型:占用8个字节。

无符号型:Uint型。32位全部用来表示正数。相应的有 ushot ,ulong

 

namespace d
{
    class Program
    {
        static void Main(string[] args)
        {

            decimal a = 44444444.12m;
            decimal b = 66666666.24m;

            decimal total;
            total = a + b;

            Console.WriteLine("{0}",total);
        }
    }
}

  实数型变量类型:float ,doulbe,decimal;

    float:单精度型,有效数字7位;

    double:双精度型,有效数字15/16位;

    decimal:金融货币,28位;

posted on 2013-04-24 22:32  杨柳清枫2012  阅读(132)  评论(0)    收藏  举报

导航