What is Boolean?

4

What exactly is Boolean? Could you give practical examples?

Does it make a difference to write true or True ?

    
asked by anonymous 23.06.2017 / 13:55

2 answers

11

Boolean, in the context that I understand you are asked, is a data type that represents only two states , true or false. This has a direct relation to the bits of the computer that only have two states 0 or 1.

Many people program but do not know that the computer only understands these two information, and only knows how to do three operations, addition, multiplication, and and ) and ( not ) bit ( Boolean circuits ). Everything else that exists on the computer is composed of all that.

Here's a beginning about Boolean algebra created by George Boole. It is similar to what we do in decimal, but it only has two digits and simpler operations.

I think you've already figured out how critical it is in programming. And here on the site there is a lot of talk about this, although nothing that gives the definition.

We use this all the time in conditions , but even though we are not realizing it is being used concretely. Is that in Boolean expressions they are evident and this is what I think you want to know.

Some people think that there is only boolean in if which is not true .

There is a lot of boolean in computing because it is the basis of everything we do.

I prefer linking articles in English that are usually much better, but it is easy to navigate to the Portuguese version.

Case insensitive

Imagining that you are talking about True , or true or TRUE , or even .T. , or 1 , that is the syntax representation. No matter, this does not change anything for Boolean algebra, it's just the convention of each language, concept and result is the same.

In languages that do not have box sensitivity, you can write in uppercase and lowercase that works, but I think it should be consistent and maintain a standard adopted by everyone, so I'm a little against insensitive languages, except for microscripts .

In sensitive languages you need to see which is the word or symbol that is considered with Boolean literal. If it is true , writing True is something very different and does not represent a true one.

If you're talking about Boolean and boolean , then it's already been answered in What is the difference between Boolean and boolean ? .

    
23.06.2017 / 14:35
1

Boolean * In computer science, Boolean is a primitive data type that has two values, which can be considered as 0 or 1, false or true.

    
23.06.2017 / 14:25