bool type

C# bool type (System.Boolean) can only take two values: true or false.

The result of comparison operators: ==, >, < >=, <= is bool type value.


using System;

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

        double d = 1D;
        double d2 = 0.1D;

        bool result = d == d2;
        Console.WriteLine("result is "+ result);


    }
}

The result:


result is False
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.