boolean vs. bitwise operators

Top  Previous  Next

What is translated > Operators > boolean vs. bitwise operators


In C# two manners of use of the Delphi operators "and" and "or" have to be distinguished.


If these operators are between expressions which result in boolean values, then the complete expression results in a boolean value in accordance with the boolean logic. The boolean "and" operator in C# is "&&" and the boolean "or" operator in C# is "||".


If the "and" operator or the "or" operator is, however, enclosed by expressions which don't yield boolean values, then the results are connected bitwise. In this case the corresponding C# operators are "|" and " &".


This page belongs to the Delphi2C# Documentation

Delphi2C# home  Content