ECMA-334: 11.1.8 The bool type
Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio
| C# Language Specification |
| © 2006 ECMA International |
11.1.8 The bool type
The bool type represents Boolean logical quantities. The possible values of type bool are true and
false.
No standard conversions exist between bool and other types. In particular, the bool type is distinct and
separate from the integral types, and a bool value cannot be used in place of an integral value, and vice
versa.
[Note: In the C and C++ languages, a zero integral or floating-point value, or a null pointer can be converted
to the Boolean value false, and a non-zero integral or floating-point value, or a non-null pointer can be
converted to the Boolean value true. In C#, such conversions are accomplished by explicitly comparing an
integral or floating-point value to zero, or by explicitly comparing an object reference to null. end note]