true if value is not zero; otherwise, false.
The following example demonstrates converting int values to bool values.
C# Example
using System; class ConvertBoolTest { static public void Main() { int int0 = 0; int int1 = 1; int int2 = -2; bool bool0 = Convert.ToBoolean(int0); bool bool1 = Convert.ToBoolean(int1); bool bool2 = Convert.ToBoolean(int2); Console.WriteLine("(int) {0} as bool = {1}",int0,bool0); Console.WriteLine("(int) {0} as bool = {1}",int1,bool1); Console.WriteLine("(int) {0} as bool = {1}",int2,bool2); } }
The output is
(int) 0 as bool = False