Decimal ranges : decimal « Data Type « C# / CSharp Tutorial






using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Security.Cryptography;

public class MainClass
{
    public static void Main()
    {
        Console.WriteLine("{0}: bytes: {1}, range: [{2},{3}]",
            typeof(float).ToString(), sizeof(float), float.MinValue, float.MaxValue);
        Console.WriteLine("{0}: bytes: {1}, range: [{2},{3}]",
            typeof(double).ToString(), sizeof(double), double.MinValue, double.MaxValue);
        Console.WriteLine("{0}: bytes: {1}, range: [{2},{3}]",
            typeof(decimal).ToString(), sizeof(decimal), decimal.MinValue, decimal.MaxValue);
    }

}
System.Single: bytes: 4, range: [-3.402823E+38,3.402823E+38]
System.Double: bytes: 8, range: [-1.79769313486232E+308,1.79769313486232E+308]
System.Decimal: bytes: 16, range: [-79228162514264337593543950335,79228162514264337593543950335]








2.30.decimal
2.30.1.Declare decimal variable
2.30.2.To specify a decimal constant, begin the specification with a nonzero digit.
2.30.3.Manually create a decimal number.
2.30.4.The Methods and Fields Defined by Decimal
2.30.5.decimal literal
2.30.6.decimals and arithmetic operators
2.30.7.Decimal ranges
2.30.8.Specifying a Literal decimal
2.30.9.decimal Types