Difference between revisions of "Boolean Operators"
From SmartWiki
(Created page with '==AND== * The '''AND''' operator takes two operands and evaluates to ''true'' if '''both''' of its operands are true. * Also written as "&&". Example: [True Statement] AND …') |
|||
Line 4: | Line 4: | ||
* Also written as "&&". | * Also written as "&&". | ||
Example: [True Statement] AND [False Statement] ...evaluates to... '''FALSE''' | Example: [True Statement] AND [False Statement] ...evaluates to... '''FALSE''' | ||
+ | Example: [True Statement] AND [True Statement] ...evaluates to... '''TRUE''' | ||
==OR== | ==OR== | ||
Line 9: | Line 10: | ||
* The ''OR'' operator takes two [[operands]] and evaluates to ''true'' if '''either''' of the operands are true. | * The ''OR'' operator takes two [[operands]] and evaluates to ''true'' if '''either''' of the operands are true. | ||
* Also written as "||". | * Also written as "||". | ||
+ | Example: [True Statement] OR [True Statement] ...evaluates to... '''TRUE''' | ||
+ | Example: [True Statement] OR [False Statement] ...evaluates to... '''TRUE''' | ||
+ | Example: [False Statement] OR [False Statement] ...evaluates to... '''FALSE''' | ||
==NOT== | ==NOT== | ||
Line 14: | Line 18: | ||
* Reverses the "truthiness" of its operand. | * Reverses the "truthiness" of its operand. | ||
* Also written as "!", preceding its operand. | * Also written as "!", preceding its operand. | ||
+ | Example: NOT [True Statement] ...evaluates to... '''FALSE''' | ||
+ | Example: NOT [False Statement] ...evaluates to... '''TRUE''' | ||
− | + | [[Category:Glossary]] | |
− | |||
− | |||
− |
Revision as of 08:52, 25 June 2013
AND
- The AND operator takes two operands and evaluates to true if both of its operands are true.
- Also written as "&&".
Example: [True Statement] AND [False Statement] ...evaluates to... FALSE Example: [True Statement] AND [True Statement] ...evaluates to... TRUE
OR
- The OR operator takes two operands and evaluates to true if either of the operands are true.
- Also written as "||".
Example: [True Statement] OR [True Statement] ...evaluates to... TRUE Example: [True Statement] OR [False Statement] ...evaluates to... TRUE Example: [False Statement] OR [False Statement] ...evaluates to... FALSE
NOT
- Reverses the "truthiness" of its operand.
- Also written as "!", preceding its operand.
Example: NOT [True Statement] ...evaluates to... FALSE Example: NOT [False Statement] ...evaluates to... TRUE