Boolean
Contents
Definition
A variable having two possible values called “true” and “false.” It can be thought of as a binary value.
What does this mean
Similar to how Base 2 operates, Boolean also can only exist in 2 states, either 0 or 1. But in computer programming, we don't do any calculations with boolean. We simply tell the computer whether an element or condition is true or false.
Relevance
Explanation
A boolean is a data type intended to represent the two truth values of logic and Boolean algebra.
In programming and coding, you can create your own boolean variable and set it to true or false by saying “bool (nameOfYourVariable) = true;”
Boolean variables can be named with words and phrases that relate to a true/false conditional statement, such as “is,” “has,” etc.
Example
Here’s an example related to pizza:
bool tastesGood = true;
bool isCheesy = false;
bool hasTomatoes = true;
Booleans are typically used for conditional statements!
if(tastesGood == true)
{
bool customerSatisfied = true;
}
Resources
https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/boolean-data-type