Knowledge (XXG)

Boolean data type

Source 📝

31: 869:. The language guarantees that any two true values will compare equal (which was impossible to achieve before the introduction of the type). Boolean values still behave as integers, can be stored in integer variables, and used anywhere integers would be valid, including in indexing, arithmetic, parsing, and formatting. This approach ( 1613:
data type. In Access it is known as a Yes/No data type which can have two values; Yes (True) or No (False). The BIT data type in Access can also can be represented numerically; True is −1 and False is 0. This differs to MS SQL Server in two ways, even though both are Microsoft products:
836:(1989), many C programmers got used to defining their own Boolean types as such, for readability reasons. However, enumerated types are equivalent to integers according to the language standards; so the effective identity between Booleans and integers is still valid for C programs. 1719:
has no Boolean type, it uses regular integers: value 0 (all bits low) represents false, and -1 (all bits high) represents true. This allows the language to define only one set of logical operators, instead of one for mathematical calculations and one for conditions.
1479:, Boolean value is not supported at all, neither as a standalone data type nor representable as an integer. It shows the error message "An expression of non-Boolean type specified in a context where a condition is expected" if a column is directly used in the 1938: 910:
value can be implicitly converted to any integral type, with false becoming 0 and true becoming 1. The numeric literals 0 and 1 can be implicitly converted to the bool values false and true, respectively. Casting an expression to
906:
type is a byte-sized type that can only hold the value true or false. The only operators that can accept operands of type bool are: &, |, ^, &=, |=, ^=, !, &&, || and ?:. A
1930: 1237:, etc.) are considered Boolean false; all other values are considered Boolean true by default. Classes can define how their instances are treated in a Boolean context through the special method 883:, but with automatic conversions from scalar and pointer values that are very similar to those of C. This approach was adopted also by many later languages, especially by some 1899: 1417:
values. However, if it is nullable, which is the default like all other SQL data types, it can have the special null value also. Although the SQL standard defines three
441: 461: 401: 2314: 481: 421: 2328: 2265: 185:), or as a bit string of length one, which can store only two values. The implementation of Booleans in computers are most likely represented as a full 2096: 753:
type had all the facilities which were available for enumerated types in general, such as ordering and use as indices. In contrast, converting between
2665: 181:, etc., treat any non-zero value as true. Indeed, a Boolean variable may be regarded (and implemented) as a numerical variable with one binary digit ( 3036: 2670: 2243: 1863: 2660: 2655: 2390: 2200: 2164: 829: 2290: 2643: 2544: 1229:
of 1 and 0 respectively and behave as such in arithmetic contexts. Also, a numeric value of zero (integer or fractional), the null value (
873:) has been retained in all later versions of C. Note, that this does not mean that any integer value can be stored in a Boolean variable. 2454: 1988: 75: 1840: 1802: 346:
can store all logical values resulting from the evaluation of predicates in SQL. A column of Boolean type can be restricted to just
2074: 1441:"may be used interchangeably to mean exactly the same thing". This has caused some controversy because the identification subjects 487:
limits on many computers of the time, however, most compilers used alternative representations for many of the operators, such as
1896: 1249:(the special method for determining the length of containers) is used if the explicit Boolean conversion method is not defined. 2794: 2911: 2716: 2648: 2610: 1418: 770: 531: 74:, who first defined an algebraic system of logic in the mid 19th century. The Boolean data type is primarily associated with 2430: 192:
Most programming languages, even those with no explicit Boolean type, have support for Boolean algebraic operations such as
1729: 1202: 714: 674: 519: 107: 2131: 2811: 2741: 2589: 1716: 308: 186: 3066: 2044: 1253: 1210: 950: 615: 527: 288: 142: 111: 757:
s and integers (or any other types) still required explicit tests or function calls, as in ALGOL 60. This approach (
2821: 2689: 1781: 1118:
has no separate Boolean type. Like in C, the integers 0 (false) and 1 (true—in fact any nonzero integer) are used.
1018: 766: 523: 154: 2999: 2951: 2863: 2841: 2836: 2764: 2630: 1749: 997: 3097: 3087: 2873: 2537: 1325:
Booleans. As opposed to Python, empty containers (Arrays, Maps, Sets) are considered truthy. Languages such as
840: 782: 726: 2219: 3026: 2941: 2103: 1310: 745:. By definition, all comparisons, logical operations, and conditional statements applied to and/or yielded 550:
statement takes an arithmetic expression and branches to one of three locations according to its sign; see
2769: 2625: 2584: 2579: 1739: 1606: 1025:
evaluates to false, whereas every other data type value evaluates to true. This includes the empty string
915:
means testing for 0 or !=0 for arithmetic types, and null or !=null for pointers or references.
895: 2503: 2759: 2734: 2014: 685:, even ones having a distinct Boolean type or Boolean values; although which values are interpreted as 2235: 785:(1972) provided no Boolean type, and to this day Boolean values are commonly represented by integers ( 546:(1957) and its successor FORTRAN II (1958) have no logical values or operations; even the conditional 2561: 2398: 1856: 1786: 1476: 103: 1536:, is commonly used as a workaround to store Boolean values, but workarounds need to be used such as 976:
has no Boolean data type. Instead, any value can behave as Boolean in Boolean context (condition of
3092: 3031: 3009: 2936: 2789: 2781: 2701: 2530: 933:, equivalents of true and false respectively. Also, in Objective-C compilers that support C99, C's 503: 225: 209: 193: 115: 91: 1916: 3014: 2994: 2946: 2921: 2706: 2675: 1744: 1734: 884: 682: 331: 2412: 1353:
clause, in form of predicate which is produced by using operators such as comparison operators,
1048:
has no Boolean data type. Instead, comparison operators generate BIT(1) values; '0'B represents
189:, rather than a bit; this is usually due to the ways computers transfer blocks of information. 2831: 2806: 2620: 2615: 2308: 2196: 2190: 2160: 1836: 1798: 554:. FORTRAN IV (1962), however, follows the ALGOL 60 example by providing a Boolean data type ( 426: 2478: 2154: 1832: 1822: 1794: 446: 386: 3046: 2931: 2729: 2376: 2036: 1690: 1602: 296: 150: 39: 1984: 1021:
has a Boolean data type, but non-Boolean values can also behave as Booleans. The non-value
466: 406: 3051: 2916: 2868: 2801: 2223: 1903: 1828: 1772: 1753: 1344: 1322: 1234: 718: 67: 2066: 1390:
operators which evaluate a predicate, which predated the introduction of Boolean type in
3004: 2826: 2816: 2724: 1776: 1609:(ACE/JET), also does not have a Boolean data type. Similar to MS SQL Server, it uses a 2352: 2216: 1087:
has no Boolean data type. Instead, comparison operators generate 0 or 1; 0 represents
3081: 2926: 1818: 1790: 551: 484: 618:(1958) never had a built-in Boolean data type. Instead, conditional constructs like 2883: 2858: 1960: 852: 639: 241: 127: 79: 71: 30: 1068:, are converted to bit strings and the operations are performed on each bit. The 3061: 3056: 2906: 2853: 2680: 1348: 1318: 918: 670: 146: 59: 2391:"MySQL :: MySQL 8.0 Reference Manual :: 12.1.1 Numeric Type Overview" 1708:
function converts a Boolean to a number, returning 1 for True and 0 for False.
697:
value is an atom distinct from the empty list, so the latter is interpreted as
2966: 2961: 2878: 2846: 2751: 2694: 2127: 1636:
type as in the standard, which allows predicates to be stored directly into a
1629: 1458: 1374: 1338: 1276: 678: 335: 169:
are defined to have value 1 if true and 0 if false, whereas the test parts of
131: 3041: 3019: 2976: 2971: 2638: 2594: 2553: 2040: 1457:. As of 2012 few major SQL systems implement the T031 feature. Firebird and 507: 292: 153:
for false, and any other value for true. The C programming language uses an
47: 17: 761:) was adopted by most later languages which had enumerated types, such as 2956: 2413:"MySQL :: MySQL 8.0 Reference Manual :: 9.1.6 Boolean Literals" 1391: 938: 515: 372: 339: 265: 1339:
Null (SQL) § Comparisons with NULL and the three-valued logic (3VL)
737:
data type was then provided as a predefined enumerated type with values
543: 1682:
is the same is integer 0. Any non-zero integer is true in conditions.
1298: 833: 762: 730: 511: 342:) is also defined to include more than two truth values, so that SQL 138: 1625:
Access does not support the Null tri-state, supported by SQL Server
876: 801:) result, either 0 (for false) or 1 (for true). Logical operators ( 646:. For convenience, most modern dialects of Lisp predefine the atom 86:
evaluates to true or false. It is a special case of a more general
1652: 722: 63: 29: 367:
One of the earliest programming languages to provide an explicit
2574: 1084: 1045: 973: 606:') is provided for the parsing or formatting of logical values. 2526: 1409:
behaves like Booleans in other languages, which can store only
2569: 1401:
data type as an optional feature (T031). When restricted by a
1326: 1292: 1115: 888: 844: 701:. Common Lisp, on the other hand, also provides the dedicated 327: 182: 2522: 1857:"Report on the Algorithmic Language ALGOL 68, Section 10.2.2" 1472:
The treatment of Boolean values differs between SQL systems.
334:
for explicit comparisons because of its special treatment of
2010: 1532:
data type, which can only store integers 0 and 1 apart from
693:
vary from language to language. In Scheme, for example, the
145:, may still represent truth values by some other data type. 134:
commands may be defined to test Boolean-valued expressions.
1693:
has a BOOLEAN data type. The literal of a Boolean value is
821:) assume that zero is false and all other values are true. 1461:
are notable exceptions, although PostgreSQL implements no
1445:
to the equality comparison rules for NULL. More precisely
2156:
SQL and Relational Theory: How to Write Accurate SQL Code
1268:; all else (including the integer 0 and empty arrays) is 1217:, the standard integer type. It has two possible values: 510:
was adopted by many later programming languages, such as
570:
statement, Boolean-valued numeric comparison operators (
1599:
to convert between the integer and Boolean expression.
1369:, these operators can also yield a third state, called 721:, previously available with different nomenclature in 630:, which is defined to be the same as the special atom 78:
statements, which allow different actions by changing
717:(1970) popularized the concept of programmer-defined 469: 449: 429: 409: 389: 50:
that has one of two possible values (usually denoted
2291:"SQL data types (Access desktop database reference)" 82:
depending on whether a programmer-specified Boolean
2985: 2894: 2780: 2750: 2715: 2603: 2560: 1889:
DECSystem10 FORTRAN IV Programmers Reference Manual
1660: 1537: 1505: 1484: 1446: 137:Languages with no explicit Boolean data type, like 2236:"PostgreSQL: Documentation: 10: 8.6. Boolean Type" 1233:), the empty string, and empty containers (lists, 475: 455: 435: 415: 395: 2329:"Introduction to data types and field properties" 705:type, derived as a specialization of the symbol. 797:, etc.) are defined to return a signed integer ( 2479:"Boolean makes Tableau faster - true or false?" 2192:Introduction to Databases With Web Applications 1015:evaluate to false. All else evaluates to true. 126:are usually defined to return a Boolean value. 90:logic does not always need to be Boolean (see 1824:ANSI and ISO Standard C Programmer's reference 2538: 1985:"perlsyn - Perl Syntax / Truth and Falsehood" 8: 1190:The above will render an error, as variable 789:s) in C programs. The comparison operators ( 2313:: CS1 maint: numeric names: authors list ( 681:), and similar models were adopted by many 602:statements, a specific format descriptor (' 319:, respectively, so there is no one Boolean 106:with a built-in Boolean data type, such as 2545: 2531: 2523: 2266:"Migrate an Access database to SQL Server" 2217:Survey of BOOLEAN data type implementation 813:, etc.) and condition-testing statements ( 383:and logical operators denoted by symbols ' 2195:. Pearson Education Canada. p. 197. 937:type can be used, since Objective-C is a 468: 448: 428: 408: 388: 58:) which is intended to represent the two 27:Data having only values "true" or "false" 1622:as −1, while it is 1 in SQL Server 781:Initial implementations of the language 667:any value can be used as a Boolean value 157:type, where relational expressions like 1764: 658:can be used as a mnemonic notation for 338:, the Boolean data type (introduced in 2306: 921:also has a separate Boolean data type 857:, one can use the more intuitive name 669:) was retained in most Lisp dialects ( 1941:from the original on 7 September 2011 1163:since the expression evaluates to 1. 830:American National Standards Institute 161:and logical expressions connected by 7: 2455:"Formatting Calculations in Tableau" 1644:column directly as a predicate in a 2353:"Boolean Data - MS-Access Tutorial" 2159:. O'Reilly Media, Inc. p. 83. 2097:"ECMAScript Language Specification" 1991:from the original on 26 August 2013 1397:The SQL:1999 standard introduced a 1076:statement is true if any bit is 1. 363:ALGOL and the built-in BOOLEAN type 46:(sometimes shortened to Bool) is a 2134:from the original on 17 March 2011 2128:"The Elements of JavaScript Style" 2017:from the original on 28 March 2018 1317:) to distinguish between strictly 1260:(Ruby's null value) and a special 1205:, from version 2.3 forward, has a 1033:, which are very often considered 847:) provides a Boolean type, called 483:' (not). Due to input device and 470: 25: 2246:from the original on 9 March 2018 1869:from the original on 6 April 2008 879:has a separate Boolean data type 626:is represented by the empty list 358:Language-specific implementations 2077:from the original on 22 May 2013 871:Boolean values are just integers 578:, etc.), and logical operators ( 2047:from the original on 1 May 2013 2041:"PEP 285 -- Adding a bool type" 2011:"PEP 285 -- Adding a bool type" 1893:Mathematical Languages Handbook 1887:Digital Equipment Corporation, 1194:cannot be evaluated as 0 or 1. 898:has a proper boolean data type 1965:W3Schools Online Web Tutorials 1384:IS (NOT) TRUE, IS (NOT) FALSE, 1382:The SQL92 standard introduced 1343:Booleans appear in SQL when a 622:assume that the logical value 1: 2611:Arbitrary-precision or bignum 1730:Boolean differential calculus 1678:is the same as integer 1 and 957:data type can only be either 925:, with possible values being 759:Boolean is an enumerated type 2504:"4. Decisions, Decisions..." 2102:. p. 43. Archived from 1717:Forth (programming language) 1504:, while a statement such as 1245:(Python 3). For containers, 1198:Python, Ruby, and JavaScript 2071:Python v3.3.2 documentation 1640:column, and allows using a 1528:yields a syntax error. The 777:C, C++, D, Objective-C, AWK 3114: 1782:The C Programming Language 1659:is treated as an alias of 1336: 1151:"V is 1 or true" 851:. By including the header 307:values belong to separate 2952:Strongly typed identifier 1750:True and false (commands) 1361:etc. However, apart from 1095:. The operands of, e.g., 1056:. The operands of, e.g., 506:or otherwise predefined) 2189:Martyn Prigmore (2007). 2179:ISO/IEC 9075-2:2011 §4.5 1931:"Guides and Sample Code" 1433:— it also says that the 1329:also use this approach. 1165: 1123: 1011:, and the special value 824:After enumerated types ( 749:values. Otherwise, the 709:Pascal, Ada, and Haskell 436:{\displaystyle \supset } 287:In some languages, like 3027:Parametric polymorphism 1821:; Brodie, Jim (1992) . 1373:, when comparison with 984:statement, argument of 456:{\displaystyle \equiv } 396:{\displaystyle \wedge } 1607:Access Database Engine 896:D programming language 534:(2000), among others. 502:as a built-in (either 477: 463:' (equivalence), and ' 457: 437: 417: 397: 35: 2333:support.microsoft.com 2270:support.microsoft.com 2130:. Douglas Crockford. 1469:can be used instead. 1305:are sometimes called 828:s) were added to the 542:The first version of 478: 476:{\displaystyle \neg } 458: 438: 418: 416:{\displaystyle \vee } 398: 104:programming languages 33: 1917:"CLHS: Type BOOLEAN" 1906:accessed 2011-11-16. 1787:Englewood Cliffs, NJ 1477:Microsoft SQL Server 1279:, the empty string ( 1256:, in contrast, only 1159:The above will show 1121:Examples of coding: 1052:and '1'B represents 1037:in other languages. 992:, etc.). The number 638:; whereas any other 467: 447: 427: 407: 387: 116:comparison operators 70:. It is named after 3032:Primitive data type 2937:Recursive data type 2790:Algebraic data type 2666:Quadruple precision 1935:developer.apple.com 1740:Shannon's expansion 1347:is needed, such as 953:, the value of the 885:scripting languages 683:scripting languages 558:), truth literals ( 498:This approach with 375:(1960) with values 92:probabilistic logic 2995:Abstract data type 2676:Extended precision 2635:Reduced precision 2379:. 27 October 2016. 2295:docs.microsoft.com 2240:www.postgresql.org 2222:2005-03-09 at the 1902:2011-08-14 at the 1773:Kernighan, Brian W 1745:Three-valued logic 1735:Flag (programming) 1618:Access represents 1405:constraint, a SQL 1107:, must be 0 or 1. 1070:element-expression 861:and the constants 642:is interpreted as 473: 453: 433: 413: 393: 332:three-valued logic 244:/non-equivalence ( 88:logical data type— 36: 3075: 3074: 2807:Associative array 2671:Octuple precision 2202:978-0-321-26359-9 2166:978-1-4493-1640-2 2037:van Rossum, Guido 1777:Ritchie, Dennis M 1605:, which uses the 1447:UNKNOWN = UNKNOWN 1091:and 1 represents 1007:, the empty list 16:(Redirected from 3105: 3047:Type constructor 2932:Opaque data type 2864:Record or Struct 2661:Double precision 2656:Single precision 2547: 2540: 2533: 2524: 2518: 2517: 2515: 2514: 2500: 2494: 2493: 2491: 2490: 2475: 2469: 2468: 2466: 2465: 2459:help.tableau.com 2451: 2445: 2444: 2442: 2441: 2435:help.tableau.com 2427: 2421: 2420: 2409: 2403: 2402: 2397:. Archived from 2387: 2381: 2380: 2373: 2367: 2366: 2364: 2363: 2349: 2343: 2342: 2340: 2339: 2325: 2319: 2318: 2312: 2304: 2302: 2301: 2286: 2280: 2279: 2277: 2276: 2262: 2256: 2255: 2253: 2251: 2232: 2226: 2213: 2207: 2206: 2186: 2180: 2177: 2171: 2170: 2153:C. Date (2011). 2150: 2144: 2143: 2141: 2139: 2124: 2118: 2117: 2115: 2114: 2108: 2101: 2093: 2087: 2086: 2084: 2082: 2063: 2057: 2056: 2054: 2052: 2039:(3 April 2002). 2033: 2027: 2026: 2024: 2022: 2007: 2001: 2000: 1998: 1996: 1981: 1975: 1974: 1972: 1971: 1957: 1951: 1950: 1948: 1946: 1927: 1921: 1920: 1913: 1907: 1885: 1879: 1878: 1876: 1874: 1868: 1861: 1853: 1847: 1846: 1815: 1809: 1808: 1785:(1st ed.). 1769: 1707: 1700: 1696: 1691:Tableau Software 1681: 1677: 1673: 1672: 1669: 1666: 1663: 1658: 1647: 1643: 1639: 1635: 1621: 1612: 1603:Microsoft Access 1598: 1597: 1594: 1591: 1588: 1585: 1582: 1579: 1576: 1573: 1570: 1567: 1564: 1561: 1558: 1555: 1552: 1549: 1546: 1543: 1540: 1535: 1531: 1527: 1526: 1523: 1520: 1517: 1514: 1511: 1508: 1503: 1502: 1499: 1496: 1493: 1490: 1487: 1482: 1475:For example, in 1468: 1464: 1456: 1452: 1448: 1444: 1440: 1436: 1432: 1428: 1424: 1416: 1412: 1408: 1404: 1400: 1389: 1388:IS (NOT) UNKNOWN 1385: 1377: 1372: 1368: 1364: 1360: 1356: 1351: 1304: 1295: 1290: 1286: 1282: 1263: 1259: 1248: 1244: 1240: 1232: 1227:special versions 1224: 1220: 1216: 1209:type which is a 1208: 1193: 1185: 1182: 1179: 1176: 1173: 1169: 1162: 1155: 1152: 1149: 1146: 1143: 1140: 1137: 1134: 1131: 1127: 1106: 1102: 1098: 1075: 1067: 1063: 1059: 1036: 1032: 1028: 1024: 1014: 1010: 1006: 1002: 995: 991: 987: 983: 979: 964: 960: 956: 936: 932: 928: 924: 914: 909: 905: 901: 882: 868: 864: 860: 855: 850: 827: 820: 816: 812: 808: 804: 800: 796: 792: 788: 756: 752: 748: 744: 740: 736: 719:enumerated types 704: 657: 653: 649: 637: 633: 629: 621: 605: 601: 597: 593: 589: 585: 581: 577: 573: 569: 565: 561: 557: 549: 501: 494: 490: 482: 480: 479: 474: 462: 460: 459: 454: 442: 440: 439: 434: 422: 420: 419: 414: 402: 400: 399: 394: 370: 353: 349: 318: 314: 283: 279: 275: 271: 263: 259: 255: 251: 247: 239: 235: 231: 223: 219: 215: 207: 203: 199: 180: 176: 172: 168: 164: 160: 125: 121: 40:computer science 21: 3113: 3112: 3108: 3107: 3106: 3104: 3103: 3102: 3098:Primitive types 3088:Boolean algebra 3078: 3077: 3076: 3071: 3052:Type conversion 2987: 2981: 2917:Enumerated type 2890: 2776: 2770:null-terminated 2746: 2711: 2599: 2556: 2551: 2521: 2512: 2510: 2502: 2501: 2497: 2488: 2486: 2477: 2476: 2472: 2463: 2461: 2453: 2452: 2448: 2439: 2437: 2429: 2428: 2424: 2411: 2410: 2406: 2389: 2388: 2384: 2375: 2374: 2370: 2361: 2359: 2357:sourcedaddy.com 2351: 2350: 2346: 2337: 2335: 2327: 2326: 2322: 2305: 2299: 2297: 2288: 2287: 2283: 2274: 2272: 2264: 2263: 2259: 2249: 2247: 2234: 2233: 2229: 2224:Wayback Machine 2214: 2210: 2203: 2188: 2187: 2183: 2178: 2174: 2167: 2152: 2151: 2147: 2137: 2135: 2126: 2125: 2121: 2112: 2110: 2106: 2099: 2095: 2094: 2090: 2080: 2078: 2065: 2064: 2060: 2050: 2048: 2035: 2034: 2030: 2020: 2018: 2009: 2008: 2004: 1994: 1992: 1983: 1982: 1978: 1969: 1967: 1961:"Java Booleans" 1959: 1958: 1954: 1944: 1942: 1929: 1928: 1924: 1915: 1914: 1910: 1904:Wayback Machine 1891:. Reprinted in 1886: 1882: 1872: 1870: 1866: 1862:. August 1968. 1859: 1855: 1854: 1850: 1843: 1829:Microsoft Press 1817: 1816: 1812: 1805: 1771: 1770: 1766: 1762: 1754:shell scripting 1726: 1714: 1705: 1698: 1694: 1688: 1679: 1675: 1670: 1667: 1664: 1661: 1656: 1645: 1641: 1637: 1633: 1632:has a distinct 1619: 1610: 1595: 1592: 1589: 1586: 1583: 1580: 1577: 1574: 1571: 1568: 1565: 1562: 1559: 1556: 1553: 1550: 1547: 1544: 1541: 1538: 1533: 1529: 1524: 1521: 1518: 1515: 1512: 1509: 1506: 1500: 1497: 1494: 1491: 1488: 1485: 1480: 1466: 1462: 1454: 1450: 1442: 1438: 1434: 1430: 1426: 1422: 1414: 1410: 1406: 1402: 1398: 1387: 1383: 1375: 1370: 1366: 1362: 1358: 1354: 1349: 1341: 1335: 1302: 1293: 1288: 1284: 1280: 1261: 1257: 1246: 1242: 1238: 1230: 1222: 1218: 1214: 1206: 1200: 1191: 1188: 1187: 1183: 1180: 1177: 1174: 1171: 1167: 1160: 1157: 1156: 1153: 1150: 1147: 1144: 1141: 1138: 1135: 1132: 1129: 1125: 1113: 1104: 1100: 1096: 1082: 1073: 1065: 1061: 1057: 1043: 1034: 1030: 1029:and the number 1026: 1022: 1012: 1008: 1004: 1000: 993: 989: 985: 981: 977: 971: 962: 958: 954: 947: 934: 930: 926: 922: 912: 907: 903: 899: 880: 866: 862: 858: 853: 848: 825: 818: 814: 810: 806: 802: 798: 794: 790: 786: 779: 754: 750: 746: 742: 738: 734: 711: 702: 665:This approach ( 655: 651: 647: 635: 631: 627: 619: 612: 610:Lisp and Scheme 603: 599: 595: 591: 587: 583: 579: 575: 571: 567: 563: 559: 555: 547: 540: 499: 492: 488: 465: 464: 445: 444: 425: 424: 405: 404: 385: 384: 368: 365: 360: 351: 347: 330:, which uses a 316: 312: 281: 277: 273: 269: 261: 257: 253: 249: 245: 237: 233: 229: 221: 217: 213: 205: 201: 197: 178: 174: 170: 166: 162: 158: 123: 119: 100: 68:Boolean algebra 28: 23: 22: 15: 12: 11: 5: 3111: 3109: 3101: 3100: 3095: 3090: 3080: 3079: 3073: 3072: 3070: 3069: 3064: 3059: 3054: 3049: 3044: 3039: 3034: 3029: 3024: 3023: 3022: 3012: 3007: 3005:Data structure 3002: 2997: 2991: 2989: 2983: 2982: 2980: 2979: 2974: 2969: 2964: 2959: 2954: 2949: 2944: 2939: 2934: 2929: 2924: 2919: 2914: 2909: 2904: 2898: 2896: 2892: 2891: 2889: 2888: 2887: 2886: 2876: 2871: 2866: 2861: 2856: 2851: 2850: 2849: 2839: 2834: 2829: 2824: 2819: 2814: 2809: 2804: 2799: 2798: 2797: 2786: 2784: 2778: 2777: 2775: 2774: 2773: 2772: 2762: 2756: 2754: 2748: 2747: 2745: 2744: 2739: 2738: 2737: 2732: 2721: 2719: 2713: 2712: 2710: 2709: 2704: 2699: 2698: 2697: 2687: 2686: 2685: 2684: 2683: 2673: 2668: 2663: 2658: 2653: 2652: 2651: 2646: 2644:Half precision 2641: 2631:Floating point 2628: 2623: 2618: 2613: 2607: 2605: 2601: 2600: 2598: 2597: 2592: 2587: 2582: 2577: 2572: 2566: 2564: 2558: 2557: 2552: 2550: 2549: 2542: 2535: 2527: 2520: 2519: 2495: 2470: 2446: 2422: 2404: 2401:on 2016-09-22. 2382: 2377:"Boolean Type" 2368: 2344: 2320: 2281: 2257: 2227: 2215:Troels Arvin, 2208: 2201: 2181: 2172: 2165: 2145: 2119: 2088: 2058: 2028: 2013:. 4 May 2011. 2002: 1976: 1952: 1922: 1908: 1897:Online version 1880: 1848: 1841: 1810: 1803: 1763: 1761: 1758: 1757: 1756: 1747: 1742: 1737: 1732: 1725: 1722: 1713: 1710: 1687: 1684: 1627: 1626: 1623: 1337:Main article: 1334: 1331: 1309:(of which the 1241:(Python 2) or 1199: 1196: 1166: 1161:V is 1 or true 1124: 1112: 1109: 1081: 1078: 1042: 1039: 970: 967: 946: 943: 832:version of C, 778: 775: 710: 707: 689:and which are 650:to have value 611: 608: 539: 536: 472: 452: 443:' (implies), ' 432: 412: 392: 364: 361: 359: 356: 149:uses an empty 99: 96: 26: 24: 14: 13: 10: 9: 6: 4: 3: 2: 3110: 3099: 3096: 3094: 3091: 3089: 3086: 3085: 3083: 3068: 3065: 3063: 3060: 3058: 3055: 3053: 3050: 3048: 3045: 3043: 3040: 3038: 3035: 3033: 3030: 3028: 3025: 3021: 3018: 3017: 3016: 3013: 3011: 3008: 3006: 3003: 3001: 2998: 2996: 2993: 2992: 2990: 2984: 2978: 2975: 2973: 2970: 2968: 2965: 2963: 2960: 2958: 2955: 2953: 2950: 2948: 2945: 2943: 2940: 2938: 2935: 2933: 2930: 2928: 2927:Function type 2925: 2923: 2920: 2918: 2915: 2913: 2910: 2908: 2905: 2903: 2900: 2899: 2897: 2893: 2885: 2882: 2881: 2880: 2877: 2875: 2872: 2870: 2867: 2865: 2862: 2860: 2857: 2855: 2852: 2848: 2845: 2844: 2843: 2840: 2838: 2835: 2833: 2830: 2828: 2825: 2823: 2820: 2818: 2815: 2813: 2810: 2808: 2805: 2803: 2800: 2796: 2793: 2792: 2791: 2788: 2787: 2785: 2783: 2779: 2771: 2768: 2767: 2766: 2763: 2761: 2758: 2757: 2755: 2753: 2749: 2743: 2740: 2736: 2733: 2731: 2728: 2727: 2726: 2723: 2722: 2720: 2718: 2714: 2708: 2705: 2703: 2700: 2696: 2693: 2692: 2691: 2688: 2682: 2679: 2678: 2677: 2674: 2672: 2669: 2667: 2664: 2662: 2659: 2657: 2654: 2650: 2647: 2645: 2642: 2640: 2637: 2636: 2634: 2633: 2632: 2629: 2627: 2624: 2622: 2619: 2617: 2614: 2612: 2609: 2608: 2606: 2602: 2596: 2593: 2591: 2588: 2586: 2583: 2581: 2578: 2576: 2573: 2571: 2568: 2567: 2565: 2563: 2562:Uninterpreted 2559: 2555: 2548: 2543: 2541: 2536: 2534: 2529: 2528: 2525: 2508: 2505: 2499: 2496: 2484: 2483:TAR Solutions 2480: 2474: 2471: 2460: 2456: 2450: 2447: 2436: 2432: 2426: 2423: 2418: 2417:dev.mysql.com 2414: 2408: 2405: 2400: 2396: 2395:dev.mysql.com 2392: 2386: 2383: 2378: 2372: 2369: 2358: 2354: 2348: 2345: 2334: 2330: 2324: 2321: 2316: 2310: 2296: 2292: 2285: 2282: 2271: 2267: 2261: 2258: 2245: 2241: 2237: 2231: 2228: 2225: 2221: 2218: 2212: 2209: 2204: 2198: 2194: 2193: 2185: 2182: 2176: 2173: 2168: 2162: 2158: 2157: 2149: 2146: 2133: 2129: 2123: 2120: 2109:on 2015-04-12 2105: 2098: 2092: 2089: 2076: 2072: 2068: 2067:"Expressions" 2062: 2059: 2046: 2042: 2038: 2032: 2029: 2016: 2012: 2006: 2003: 1990: 1986: 1980: 1977: 1966: 1962: 1956: 1953: 1940: 1936: 1932: 1926: 1923: 1918: 1912: 1909: 1905: 1901: 1898: 1894: 1890: 1884: 1881: 1865: 1858: 1852: 1849: 1844: 1842:1-55615-359-7 1838: 1834: 1830: 1826: 1825: 1820: 1814: 1811: 1806: 1804:0-13-110163-3 1800: 1796: 1792: 1791:Prentice Hall 1788: 1784: 1783: 1778: 1774: 1768: 1765: 1759: 1755: 1751: 1748: 1746: 1743: 1741: 1738: 1736: 1733: 1731: 1728: 1727: 1723: 1721: 1718: 1711: 1709: 1702: 1692: 1685: 1683: 1654: 1649: 1631: 1624: 1617: 1616: 1615: 1608: 1604: 1600: 1483:clause, e.g. 1478: 1473: 1470: 1460: 1420: 1395: 1393: 1380: 1378: 1359:IS (NOT) NULL 1352: 1346: 1340: 1332: 1330: 1328: 1324: 1320: 1316: 1312: 1308: 1300: 1296: 1278: 1273: 1271: 1267: 1255: 1250: 1236: 1228: 1212: 1204: 1197: 1195: 1164: 1122: 1119: 1117: 1110: 1108: 1094: 1090: 1086: 1079: 1077: 1071: 1055: 1051: 1047: 1040: 1038: 1020: 1016: 999: 975: 968: 966: 952: 944: 942: 940: 920: 916: 897: 892: 890: 886: 878: 874: 872: 856: 846: 842: 837: 835: 831: 822: 784: 776: 774: 772: 768: 764: 760: 733:. A built-in 732: 728: 724: 720: 716: 713:The language 708: 706: 700: 696: 692: 688: 684: 680: 676: 672: 668: 663: 661: 645: 641: 625: 617: 614:The language 609: 607: 553: 552:arithmetic IF 545: 537: 535: 533: 529: 525: 521: 517: 513: 509: 505: 496: 486: 485:character set 450: 430: 410: 390: 382: 378: 374: 371:data type is 362: 357: 355: 345: 341: 337: 333: 329: 324: 322: 310: 306: 302: 298: 294: 290: 285: 267: 243: 227: 211: 195: 190: 188: 184: 156: 152: 148: 144: 140: 135: 133: 129: 117: 113: 109: 105: 97: 95: 93: 89: 85: 81: 77: 73: 69: 65: 61: 57: 53: 49: 45: 41: 32: 19: 2901: 2832:Intersection 2511:. Retrieved 2509:. 2022-02-11 2506: 2498: 2487:. Retrieved 2485:. 2020-09-11 2482: 2473: 2462:. Retrieved 2458: 2449: 2438:. Retrieved 2434: 2431:"Data Types" 2425: 2416: 2407: 2399:the original 2394: 2385: 2371: 2360:. Retrieved 2356: 2347: 2336:. Retrieved 2332: 2323: 2298:. Retrieved 2294: 2284: 2273:. Retrieved 2269: 2260: 2248:. Retrieved 2239: 2230: 2211: 2191: 2184: 2175: 2155: 2148: 2136:. Retrieved 2122: 2111:. Retrieved 2104:the original 2091: 2079:. Retrieved 2070: 2061: 2049:. Retrieved 2031: 2019:. Retrieved 2005: 1995:10 September 1993:. Retrieved 1979: 1968:. Retrieved 1964: 1955: 1943:. Retrieved 1934: 1925: 1911: 1892: 1888: 1883: 1871:. Retrieved 1851: 1823: 1813: 1780: 1767: 1715: 1704:The Tableau 1703: 1689: 1650: 1628: 1601: 1474: 1471: 1455:UNKNOWN/NULL 1435:NULL BOOLEAN 1427:TRUE, FALSE, 1396: 1381: 1342: 1319:type-checked 1314: 1306: 1274: 1269: 1265: 1251: 1226: 1225:, which are 1201: 1189: 1172:"" 1158: 1120: 1114: 1092: 1088: 1083: 1069: 1053: 1049: 1044: 1017: 972: 969:Perl and Lua 948: 917: 893: 875: 870: 838: 823: 780: 758: 712: 698: 694: 690: 686: 666: 664: 659: 643: 640:s-expression 623: 613: 541: 530:(1995), and 497: 380: 376: 366: 343: 325: 320: 304: 300: 286: 242:exclusive or 191: 136: 101: 98:Generalities 87: 83: 80:control flow 72:George Boole 60:truth values 55: 51: 43: 37: 34:George Boole 18:Boolean type 3062:Type theory 3057:Type system 2907:Bottom type 2854:Option type 2795:generalized 2681:Long double 2626:Fixed point 1831:. pp.  1819:Plauger, PJ 1264:object are 1239:__nonzero__ 919:Objective-C 671:Common Lisp 566:), logical 514:67 (1967), 226:equivalence 210:disjunction 194:conjunction 147:Common Lisp 128:Conditional 76:conditional 3093:Data types 3082:Categories 2967:Empty type 2962:Type class 2912:Collection 2869:Refinement 2847:metaobject 2695:signedness 2554:Data types 2513:2022-02-11 2489:2020-10-19 2464:2020-10-19 2440:2020-10-19 2362:2020-10-19 2338:2020-10-19 2300:2020-10-19 2289:o365devx. 2275:2020-10-19 2113:2011-03-12 1970:2021-02-17 1793:. p.  1760:References 1630:PostgreSQL 1459:PostgreSQL 1357:operator, 1311:complement 1277:JavaScript 986:&& 803:&& 679:Emacs Lisp 654:, so that 403:' (and), ' 163:&& 3042:Subtyping 3037:Interface 3020:metaclass 2972:Unit type 2942:Semaphore 2922:Exception 2827:Inductive 2817:Dependent 2782:Composite 2760:Character 2742:Reference 2639:Minifloat 2595:Bit array 2507:Forth Inc 1465:literal; 1379:is made. 1345:condition 1289:undefined 854:stdbool.h 839:Standard 508:data type 504:primitive 471:¬ 451:≡ 431:⊃ 423:' (or), ' 411:∨ 391:∧ 293:Smalltalk 132:iterative 84:condition 48:data type 3067:Variable 2957:Top type 2822:Equality 2730:physical 2707:Rational 2702:Interval 2649:bfloat16 2309:cite web 2244:Archived 2220:Archived 2132:Archived 2075:Archived 2045:Archived 2021:28 March 2015:Archived 1989:Archived 1939:Archived 1900:Archived 1873:30 April 1864:Archived 1779:(1978). 1724:See also 1648:clause. 1421:for the 1419:literals 1403:NOT NULL 1392:SQL:1999 1243:__bool__ 1211:subclass 939:superset 887:such as 526:(1980), 522:(1970), 518:(1970), 516:ALGOL 68 373:ALGOL 60 354:though. 344:Booleans 340:SQL:1999 311:, e.g., 266:negation 159:i > j 118:such as 3010:Generic 2986:Related 2902:Boolean 2859:Product 2735:virtual 2725:Address 2717:Pointer 2690:Integer 2621:Decimal 2616:Complex 2604:Numeric 2138:5 March 1686:Tableau 1662:TINYINT 1657:BOOLEAN 1642:BOOLEAN 1638:BOOLEAN 1634:BOOLEAN 1463:UNKNOWN 1449:is not 1443:UNKNOWN 1439:UNKNOWN 1431:UNKNOWN 1425:type – 1423:BOOLEAN 1407:BOOLEAN 1399:BOOLEAN 1371:UNKNOWN 1323:coerced 1247:__len__ 998:strings 955:boolean 843:(since 771:Haskell 755:Boolean 751:Boolean 747:Boolean 735:Boolean 703:boolean 598:). In 564:.FALSE. 556:LOGICAL 544:FORTRAN 538:Fortran 500:BOOLEAN 369:BOOLEAN 309:classes 264:), and 155:integer 44:Boolean 3000:Boxing 2988:topics 2947:Stream 2884:tagged 2842:Object 2765:String 2199:  2163:  2081:15 May 2051:15 May 1839:  1801:  1539:UPDATE 1510:column 1507:SELECT 1486:SELECT 1315:truthy 1297:, +0, 1203:Python 1072:of an 996:, the 941:of C. 902:. The 834:ANSI C 769:, and 763:Modula 731:JOVIAL 715:Pascal 675:Scheme 600:FORMAT 596:.NEQV. 594:, and 560:.TRUE. 520:Pascal 512:Simula 295:, and 114:, the 108:Pascal 42:, the 2895:Other 2879:Union 2812:Class 2802:Array 2585:Tryte 2250:1 May 2107:(PDF) 2100:(PDF) 1945:1 May 1867:(PDF) 1860:(PDF) 1833:86–93 1712:Forth 1706:INT() 1699:False 1680:FALSE 1653:MySQL 1646:WHERE 1587:WHERE 1498:WHERE 1481:WHERE 1415:FALSE 1367:FALSE 1350:WHERE 1307:falsy 1303:false 1266:false 1262:false 1223:False 1186:.... 1097:& 1089:false 1058:& 1050:false 1035:false 1013:undef 982:while 963:false 935:_Bool 867:false 849:_Bool 819:while 739:FALSE 723:COBOL 695:false 687:false 624:false 592:.EQV. 584:.AND. 580:.NOT. 493:'AND' 381:false 352:FALSE 336:Nulls 317:False 305:false 297:Alice 202:& 175:while 64:logic 56:false 3015:Kind 2977:Void 2837:List 2752:Text 2590:Word 2580:Trit 2575:Byte 2315:link 2252:2018 2197:ISBN 2161:ISBN 2140:2011 2083:2013 2053:2013 2023:2018 1997:2013 1947:2018 1875:2007 1837:ISBN 1799:ISBN 1752:for 1695:True 1676:TRUE 1620:TRUE 1590:flag 1569:NULL 1548:flag 1534:NULL 1522:FROM 1519:NULL 1492:FROM 1467:NULL 1453:but 1451:TRUE 1437:and 1429:and 1413:and 1411:TRUE 1386:and 1376:NULL 1365:and 1363:TRUE 1321:and 1301:and 1285:null 1270:true 1254:Ruby 1235:sets 1231:None 1221:and 1219:True 1207:bool 1148:puts 1093:true 1085:Rexx 1080:Rexx 1054:true 1046:PL/I 1041:PL/I 1003:and 974:Perl 959:true 951:Java 945:Java 923:BOOL 913:bool 908:bool 904:bool 900:bool 894:The 881:bool 865:and 863:true 859:bool 826:enum 791:> 743:TRUE 741:and 729:and 727:FACT 699:true 691:true 660:true 644:true 620:cond 616:Lisp 588:.OR. 576:.GT. 572:.EQ. 562:and 528:Java 379:and 377:true 350:and 348:TRUE 321:type 315:and 313:True 303:and 301:true 299:the 289:Ruby 250:NEQV 187:word 165:and 151:list 143:Lisp 141:and 130:and 122:and 120:> 112:Java 110:and 66:and 54:and 52:true 2874:Set 2570:Bit 1697:or 1651:In 1611:BIT 1566:NOT 1560:col 1554:IIF 1545:SET 1530:BIT 1516:NOT 1333:SQL 1327:PHP 1313:is 1294:NaN 1283:), 1275:In 1258:nil 1252:In 1215:int 1213:of 1181:$ v 1168:set 1139:$ v 1126:set 1116:Tcl 1111:Tcl 1023:nil 1019:Lua 1001:"0" 988:or 980:or 961:or 949:In 929:or 927:YES 889:AWK 877:C++ 845:C99 799:int 787:int 767:Ada 636:NIL 634:or 632:nil 524:Ada 491:or 489:AND 328:SQL 326:In 284:). 270:NOT 246:XOR 240:), 230:EQV 224:), 208:), 198:AND 183:bit 179:for 139:C90 102:In 94:). 62:of 38:In 3084:: 2481:. 2457:. 2433:. 2415:. 2393:. 2355:. 2331:. 2311:}} 2307:{{ 2293:. 2268:. 2242:. 2238:. 2073:. 2069:. 2043:. 1987:. 1963:. 1937:. 1933:. 1895:. 1835:. 1827:. 1797:. 1795:41 1789:: 1775:; 1701:. 1674:; 1655:, 1563:IS 1513:IS 1394:. 1355:IN 1299:−0 1291:, 1287:, 1281:"" 1272:. 1175:if 1133:if 1103:, 1099:, 1074:IF 1064:, 1060:, 1027:"" 1009:() 1005:"" 990:|| 978:if 965:. 931:NO 891:. 817:, 815:if 809:, 807:|| 805:, 795:== 793:, 773:. 765:, 725:, 677:, 673:, 662:. 628:() 590:, 586:, 582:, 574:, 568:IF 548:IF 532:C# 495:. 323:. 291:, 280:, 276:, 272:, 260:, 258:!= 256:, 252:, 248:, 238:== 236:, 232:, 220:, 216:, 214:OR 204:, 200:, 177:, 173:, 171:if 167:|| 2546:e 2539:t 2532:v 2516:. 2492:. 2467:. 2443:. 2419:. 2365:. 2341:. 2317:) 2303:. 2278:. 2254:. 2205:. 2169:. 2142:. 2116:. 2085:. 2055:. 2025:. 1999:. 1973:. 1949:. 1919:. 1877:. 1845:. 1807:. 1671:) 1668:1 1665:( 1596:0 1593:= 1584:) 1581:0 1578:, 1575:1 1572:, 1557:( 1551:= 1542:t 1525:t 1501:a 1495:t 1489:a 1192:v 1184:} 1178:{ 1170:v 1154:} 1145:{ 1142:} 1136:{ 1130:1 1128:v 1105:¬ 1101:| 1066:¬ 1062:| 1031:0 994:0 841:C 811:! 783:C 656:t 652:t 648:t 604:L 282:¬ 278:! 274:~ 268:( 262:¬ 254:^ 234:= 228:( 222:+ 218:| 212:( 206:* 196:( 124:≠ 20:)

Index

Boolean type

computer science
data type
truth values
logic
Boolean algebra
George Boole
conditional
control flow
probabilistic logic
programming languages
Pascal
Java
comparison operators
Conditional
iterative
C90
Lisp
Common Lisp
list
integer
bit
word
conjunction
disjunction
equivalence
exclusive or
negation
Ruby

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.