Table of Contents 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Notes DownloadECMA-334 C# Language Specification


14 Expressions
14.11 Conditional logical operators
14.11.1 Boolean conditional logical operators
Paragraph 11 When the operands of && or || are of type bool, or when the operands are of types that do not define an applicable operator & or operator |, but do define implicit conversions to bool, the operation is processed as follows: - 2 The operation x && y is evaluated as x ? y : false. 3 In other words, x is first evaluated and converted to type bool. 4 Then, if x is true, y is evaluated and converted to type bool, and this becomes the result of the operation. 5 Otherwise, the result of the operation is false.
- 6 The operation x || y is evaluated as x ? true : y. 7 In other words, x is first evaluated and converted to type bool. 8 Then, if x is true, the result of the operation is true. 9 Otherwise, y is evaluated and converted to type bool, and this becomes the result of the operation.
|
Jagger Software Ltd |
Company # 4070126 |
VAT # 762 5213 42 |

