old-code/monodoc/ecma334/14.11.1.xml

5 строки
1.1 KiB
XML

<?xml version="1.0"?>
<clause number="14.11.1" title="Boolean conditional logical operators">
<paragraph>When the operands of &amp;&amp; or || are of type <keyword>bool</keyword>, or when the operands are of types that do not define an applicable operator &amp; or operator |, but do define implicit conversions to <keyword>bool</keyword>, the operation is processed as follows: <list><list_item> The operation x &amp;&amp; y is evaluated as x ? y : false. In other words, x is first evaluated and converted to type <keyword>bool</keyword>. Then, if x is true, y is evaluated and converted to type <keyword>bool</keyword>, and this becomes the result of the operation. Otherwise, the result of the operation is false. </list_item><list_item> The operation x || y is evaluated as x ? true : y. In other words, x is first evaluated and converted to type <keyword>bool</keyword>. Then, if x is true, the result of the operation is true. Otherwise, y is evaluated and converted to type <keyword>bool</keyword>, and this becomes the result of the operation. </list_item></list></paragraph>
</clause>