Types/bool: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Expanded, crosslinked to wiki article on booleans. Removed from stub category (not much more info to add))
(Rewrite to prevent a very bad potential mistake)
Line 1: Line 1:


A variable type which can have one of two values: "true" or "false"; also noted as "1" or "0", "ON" or "OFF".
A variable type which can have one of two values: true or false. Care must be observed with the concepts of "truthy" and "falsey": different types will act like true in a boolean context, and nil will act like false, but they are not equal. Especially significant: "true" and "false" are truthy strings, and are not true and false.


Used in Boolean algebra, which is the foundation of digital logic and processing.  
Used in Boolean algebra, which is the foundation of digital logic and processing.  


Wikipedia has a comprehensive article on [http://en.wikipedia.org/wiki/Boolean Booleans]
Wikipedia has a comprehensive article on [http://en.wikipedia.org/wiki/Boolean Booleans]

Revision as of 20:20, 28 December 2021

A variable type which can have one of two values: true or false. Care must be observed with the concepts of "truthy" and "falsey": different types will act like true in a boolean context, and nil will act like false, but they are not equal. Especially significant: "true" and "false" are truthy strings, and are not true and false.

Used in Boolean algebra, which is the foundation of digital logic and processing.

Wikipedia has a comprehensive article on Booleans