词条 | Boolean expression |
释义 |
In computer science, a Boolean expression is used expression in a programming language that produces a Boolean value when evaluated, that is one of true or false. A Boolean expression may be composed of a combination of the Boolean constants true or false, Boolean-typed variables, Boolean-valued operators, and Boolean-valued functions.[1] Boolean expressions correspond to propositional formulas in logic and are a special case of Boolean circuits.[2] Boolean operatorsMost programming languages have the Boolean operators OR, AND and not; in C and some newer languages, these are represented by "||" (double pipe character), "&&" (double ampersand) and "!" (exclamation point) respectively, while the corresponding bitwise operations are represented by "|", "&" and "~" (tilde).[3] In the mathematical literature the symbols used are often "+" (plus), "·" (dot) and overbar, or "∨" (cup), "∧" (cap) and "¬" or "′" (prime). Examples
See also
References1. ^{{citation | last1 = Gries | first1 = David | author1-link = David Gries | last2 = Schneider | first2 = Fred B. | author2-link = Fred B. Schneider | contribution = Chapter 2. Boolean Expressions | isbn = 9780387941158 | page = 25ff | publisher = Springer | series = Monographs in Computer Science | title = A Logical Approach to Discrete Math | url = https://books.google.com/books?id=ZWTDQ6H6gsUC&pg=PA25 | year = 1993}}. 2. ^{{citation | last = van Melkebeek | first = Dieter | isbn = 9783540414926 | page = 22 | publisher = Springer | series = Lecture Notes in Computer Science | title = Randomness and Completeness in Computational Complexity | url = https://books.google.com/books?id=-S0zCjOAIVwC&pg=PA22 | volume = 1950 | year = 2000}}. 3. ^E.g. for Java see {{citation | last1 = Brogden | first1 = William B. | last2 = Green | first2 = Marcus | isbn = 9780789728616 | page = 45 | publisher = Que Publishing | title = Java 2 Programmer | url = https://books.google.com/books?id=24nPZw9Wsf4C&pg=PA45 | year = 2003}}. External links
2 : Boolean algebra|Operators (programming) |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。