Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,959 questions

51,901 answers

573 users

How to use the double type in C#

1 Answer

0 votes
using System;

namespace ConsoleApplication_C_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            double d = 3.14;

            Console.WriteLine(d);

            d = -14.89;
            Console.WriteLine(d);

            Console.WriteLine(d == -5);
            Console.WriteLine(d == -14.89);

            Console.WriteLine(d + 0.3);

            Console.WriteLine(double.MinValue);
            Console.WriteLine(double.MaxValue);

            Console.WriteLine(double.MinValue.ToString("0") + "\n");
            Console.WriteLine(double.MaxValue.ToString("0") + "\n");

            Console.WriteLine(d.GetType());
            Console.WriteLine(typeof(double));
        }
    }
}


/*
run:
  
3.14
-14.89
False
True
-14.59
-1.79769313486232E+308
1.79769313486232E+308
-1797693134862320000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000

17976931348623200000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000

System.Double
System.Double

*/

 



answered Jan 12, 2017 by avibootz
edited Jan 12, 2017 by avibootz

Related questions

1 answer 149 views
149 views asked Jan 12, 2017 by avibootz
1 answer 135 views
4 answers 412 views
1 answer 177 views
1 answer 146 views
1 answer 150 views
1 answer 316 views
...