The '''exclusive or''' (or '''either or''') operator is a [[Boolean Operators|boolean operator]] which returns {{tag|literal|true}} only if the number of true arguments is odd, else returns {{tag|literal|false}}.
+
The '''exclusive or''' (or '''either or''') operator is a [[Boolean operator]] which returns {{code|literal|true}} if and only if the number of true arguments is odd, else returns {{code|literal|false}}.
{{codeblock|{{code|keyword|I did this as long as}}{{code|whitespace| }}{{code|operator|either}}{{code|whitespace| }}{{code|variable|Applejack}}{{code|whitespace| }}{{code|operator|is}}{{code|whitespace| }}{{code|literal|23}}{{code|whitespace| }}{{code|operator|or}}{{code|whitespace| }}{{code|variable|Spike}}{{code|whitespace| }}{{code|operator|is}}{{code|whitespace| }}{{code|literal|92}}{{code|punctuation|:}}
{{codeblock|{{code|keyword|I did this as long as}}{{code|whitespace| }}{{code|operator|either}}{{code|whitespace| }}{{code|variable|Applejack}}{{code|whitespace| }}{{code|operator|is}}{{code|whitespace| }}{{code|literal|23}}{{code|whitespace| }}{{code|operator|or}}{{code|whitespace| }}{{code|variable|Spike}}{{code|whitespace| }}{{code|operator|is}}{{code|whitespace| }}{{code|literal|92}}{{code|punctuation|:}}
Line 25:
Line 25:
*[[Operators]]
*[[Operators]]
−
{{stub}}
{{Navbox/Phrases}}
{{Navbox/Phrases}}
+
{{stub}}
Revision as of 01:21, November 20, 2012
The exclusive or (or either or) operator is a Boolean operator which returns true if and only if the number of true arguments is odd, else returns false.