Sum double value - CSharp Language Basics

CSharp examples for Language Basics:double

Description

Sum double value

Demo Code

using System;// ww w  .j  a  v  a 2s.c om
class NonEquality
{
   public static void Main()
   {
      double mySum;
      mySum = 0.2f + 0.2f + 0.2f + 0.2f + 0.2f;
      if (mySum == 1.0)
         Console.WriteLine("mySum is equal to 1.0");
      Console.WriteLine("mySum holds the value " + mySum);
   }
}

Result


Related Tutorials