2,951
edits
mNo edit summary |
|||
Line 2: | Line 2: | ||
|<code>0</code> <code>1</code> | |<code>0</code> <code>1</code> | ||
|} | |} | ||
In array languages, '''Boolean''' data consists only of the [[number]]s 0 and 1 (outside of APL, [[wikipedia:Boolean_data_type|Boolean]] data may use any two values). Boolean values are used in APL whenever a "true" or "false" value is required, that is, the truth value of a logical [[wikipedia:Proposition| | In array languages, '''Boolean''' data consists only of the [[number]]s 0 and 1 (outside of APL, [[wikipedia:Boolean_data_type|Boolean]] data may use any two values). Boolean values are used in APL whenever a "true" or "false" value is required, that is, the truth value of a logical [[wikipedia:Proposition|proposition]] such as a [[comparison]] of two [[scalar]]s. The identification of "true" with 1 and "false" with 0 is a simplification of the [[Iverson bracket]], a notation which allowed a truth value to be converted into a number. A notable feature of APL implementations in relation to other language families is their tendency to use bit Booleans (eight in each byte) rather than byte Booleans, a feature which is difficult to implement but increases storage density and can also greatly speed up computation on Boolean arrays. | ||
== Examples == | == Examples == |