Top "Boolean" questions

A Boolean data type is a data type with only two possible values: true or false.

How to create a byte out of 8 bool values (and vice versa)?

I have 8 bool variables, and I want to "merge" them into a byte. Is there an easy/preferred method to …

c++ boolean bit-manipulation bit-packing
What is the best way to parse an XML boolean attribute (in .NET)?

An XML attribute declared as xs:boolean can acceptable be "true", "false", "0" or "1". However, in .NET, Boolean.Parse() will only …

.net xml .net-2.0 boolean xml-attribute
Java: Ternary with no return. (For method calling)

I was wondering if it was possible to do a ternary operation but without returning anything. If it's not possible …

java methods boolean return ternary
OpenGL bool uniform?

I'm trying to send a boolean to an OpenGL glsl shader. Currently I have this in the shader: uniform bool …

c++ opengl boolean shader
Why there isn't a single bit data type in C/C++?

For bool, it's 8 bit while has only true and false, why don't they make it single bit. And I know …

c++ c boolean bitset
Nullable bool as tri-state variable in C#

Is there any merit to using a nullable bool to store a tri-state value? For example, null == 1st state, false == 2…

c# state boolean
Comparing boolean and int using isinstance

Can someone give me an explanation why isinstance() returns True in the following case? I expected False, when writing the …

python int boolean comparison isinstance
What is the difference between false and Boolean.FALSE?

In C++ windows.h FALSE is defined as integer which makes sense for some special logic cases, but in Java …

java boolean primitive-types
Why are products called minterms and sums called maxterms?

Do they have a reason for doing so? I mean, in the sum of minterms, you look for the terms …

boolean logic boolean-logic boolean-expression boolean-operations
Java performance: true vs. Boolean.TRUE

Which of the following is better in terms of performance and efficient memory usage? Boolean isItTrue(arg){ return Boolean.TRUE; } …

java performance boolean memory-footprint