Top "Boolean-logic" questions

An algebraic system developed by George Boole.

Why are JavaScript negative numbers not always true or false?

-1 == true; // false -1 == false // false -1 ? true : false; // true Can anyone explain the above output? I know I could …

javascript boolean-logic bitwise-operators
What are bitwise operators?

I'm someone who writes code just for fun and haven't really delved into it in either an academic or professional …

javascript boolean bitwise-operators boolean-logic
How can I implement user-friendly boolean logic in a web form GUI?

Currently I have a web application where a user can use dropdown lists to generate SQL SELECT statements like so: …

user-interface boolean-logic
Boolean expression order of evaluation in Java?

Suppose I have the following expression String myString = getStringFromSomeExternalSource(); if (myString != null && myString.trim().length() != 0) { ... } Eclipse warns me …

java compiler-warnings boolean-logic boolean-expression
Implementing logical negation with only bitwise operators (except !)

~ & ^ | + << >> are the only operations I can use Before I continue, this is a homework question, …

c bit-manipulation boolean-logic negation
Convert function with only AND Boolean operations

I have some function like (A and ( B or c)) or (D and E and (F or H or R …

boolean logic boolean-logic boolean-expression boolean-operations
Convert a ushort value into two byte values in C#

How do I split a ushort into two byte variables in C#? I tried the following (package.FrameID is ushort): …

c# byte boolean-logic ushort
Better ways to find if both variables are true or both are false

I have two variables which can be either true or false. I get these by doing query on database for …

java boolean-logic
How do "and" and "or" work when combined in one statement?

For some reason this function confused me: def protocol(port): return port == "443" and "https://" or "http://" Can somebody explain the …

python boolean-logic if-statement
Dynamically evaluating simple boolean logic in Python

I've got some dynamically-generated boolean logic expressions, like: (A or B) and (C or D) A or (A and B) …

python tree logic boolean boolean-logic