double keyword in C#

C# double keyword: Here, we will find out about the double keyword in C#, what is the double keyword, how to utilize it in C#?

C# double keyword:

In C#, the float is a keyword which is utilized to pronounce a variable that can store a floating-point an incentive between the scope of ±1.5 x 10−45 to ±3.4 x 1038. float keyword is a pseudonym of System.Single.

It possesses 8 bytes (64 bits) space in the memory.

Note: Any floating-point an incentive without utilizing any postfix is considered as a double worth. We can likewise indicate a postfix d or D to speak to a double worth.


    double variable_name = value;

C# code to exhibit an example of double keyword:

Here, we are proclaiming a double factor num, instating it with the worth 12345.6789 and printing its worth, type, and size of a double sort variable.

using System;
using System.Text;

namespace Test
    class Program
        static void Main(string[] args)
            //variable declaration
            double num = 12345.6789;

            //printing value
            Console.WriteLine("num: " + num);
            //printing type of variable
            Console.WriteLine("Type of num: " + num.GetType());
            //printing size
            Console.WriteLine("Size of a double variable: " + sizeof(double));
            //printing minimum & maximum value of double
            Console.WriteLine("Min value of double: " + double.MinValue);
            Console.WriteLine("Max value of double: " + double.MaxValue);

            //hit ENTER to exit


num: 12345.6789
Type of num: System.Double
Size of a double variable: 8
Min value of double: -1.79769313486232E+308
Max value of double: 1.79769313486232E+308

Leave a Comment

error: Alert: Content is protected!!