Convert double and int To Bool - CSharp System

CSharp examples for System:Converter

Description

Convert double and int To Bool

Demo Code


using System.Globalization;
using System.Drawing;
using System;//from   w w  w  .  j a  va 2  s  .c o m

public class Main{
        public static bool ToBool(this double value)
        {
            return Math.Abs(value) > Epsilon;
        }
        public static bool ToBool(this int value)
        {
            return value != 0;
        }
}

Related Tutorials