boolean-operations Questions

4

Solved

I am aware that AND corresponds to & and NOT, ~. What is the element-wise logical OR operator? I know "or" itself is not what I am looking for.

4

Solved

Is there a "very bad thing" that can happen &&= and ||= were used as syntactic sugar for bool foo = foo && bar and bool foo = foo || bar?
Inadvisable asked 21/3, 2010 at 19:29

2

I'd like to understand how a PowerShell script handles boolean parameter values. I have a script with 4 parameters, 2 of which are boolean variables. When I run the script & set one of these pa...
Pontic asked 15/10, 2021 at 19:33

4

Solved

According to the R language definition, the difference between & and && (correspondingly | and ||) is that the former is vectorized while the latter is not. According to the help text,...

2

Can I use ~A to invert a numpy array of booleans, instead of the rather awkward functions np.logical_and() and np.invert()? Indeed, ~ seems to work fine, but I can't find it in any nympy reference ...
Ghibelline asked 5/12, 2012 at 17:15

8

Solved

Is it really a good practice to avoid using NOT operator in IF conditions in order to make your code better readable? I heard the if (doSomething()) is better then if (!doSomething()).
Submergible asked 23/1, 2011 at 17:56

6

Solved

I have a variable on javascrit, initialized at 0. What I'd like to do is this : if the value is 0, change it to 1; if the value is 1, change it to 0; and I'll avoid conditional statement (like ...
Photocell asked 2/11, 2011 at 10:7

12

Solved

How come C# doesn't have a conditional XOR operator? Example: true xor false = true true xor true = false false xor false = false
Budbudapest asked 28/6, 2011 at 14:12

5

Solved

I could not find an XNOR operator to provide this truth table: a b a XNOR b ---------------- T T T T F F F T F F F T Is there a specific operator for this? Or I need to use !(A^B)?
Allogamy asked 14/8, 2011 at 0:14

2

Solved

If I had the sum of products like z*a + z*b + z*c + ... + z*y, it would be possible to move the z factor, which is the same, out before brackets: z(a + b + c + ... y). I'd like to know how it is p...

3

Solved

In pandas, I'd like to create a computed column that's a boolean operation on two other columns. In pandas, it's easy to add together two numerical columns. I'd like to do something similar with ...
Leund asked 27/1, 2016 at 17:10

1

I have a several boolean matrices, and I want a resulting matrix that indicates if any of the elements in that position of those matrices are true. Is there a single function in the Julia language ...
Holdall asked 3/11, 2021 at 17:58

3

Solved

I want to write an if statement of the form if (all entries in booleanList are true) {do something} Just putting in the booleanList does the equivalent of .any() I could not find an answer on th...
Timecard asked 19/2, 2020 at 14:1

3

Solved

This has me utterly baffled. Sub testChangeBoolean() Dim X As Boolean ' default value is False X = True ' X is now True X = Not X ' X is back to False End Sub But I'm trying to toggle t...
Inhabited asked 12/12, 2019 at 18:30

9

Solved

I am confused as to when I should use Boolean vs bitwise operators and vs & or vs | Could someone enlighten me as to when do i use each and when will using one over the other affect my resu...
Last asked 2/10, 2010 at 8:52

3

I'm beginner in constraint programming and I'm using Google or-tools library in my c# program. I want to add following constraint to my solver: ((t1 >= 12 && t1 <= 15) || (t2 >= 16 &...

1

Solved

I’m trying to figure out what the differences are between the above-mentioned routines, and if statements like say $y.Bool; say $y.so; say ? $y; say so $y; would ever produce a different result....
Estimate asked 23/6, 2019 at 12:40

4

Solved

In C# there are various ways to do this C# Pass bitwise operator as parameter specifically the "Bitwise.Operator.OR" object, but can something like this be done in JavaScript? For example: functio...
Barbosa asked 29/4, 2019 at 2:52

5

Does a Javascript library exist which can perform boolean operations on paths (bezier curves)? I know about Paper.js and Raphael.js, but both cannot perform these actions now.
Rhodarhodamine asked 9/8, 2012 at 9:50

1

Solved

I've got two boolean vectors a = [1,1,1] and b = [0,1,1] where obviously 1 stands for true and 0 for false. I want to calculate their inner product using Boolean algebra. The result I want is ther...
Pastypat asked 18/5, 2018 at 9:32

7

Solved

Its the same thing right? Or is there a slight difference? I just wanna make sure I'm not misunderstanding anything.

5

Solved

Do they have a reason for doing so? I mean, in the sum of minterms, you look for the terms with the output 1; I don't get why they call it "minterms." Why not maxterms because 1 is well bigger than...

2

Solved

I am working with Room persistent database in my project. I have a table in which there is a column for Boolean values as in 0 or 1, now i want the count of all Boolean values whose value is true (...
Serinaserine asked 18/12, 2017 at 7:56

3

Solved

I want to control the execution of a function using a placeholder, but keep getting an error "Using a tf.Tensor as a Python bool is not allowed". Here is the code that produces this error: import ...
Redfish asked 6/4, 2017 at 19:14

5

Solved

I read that the double pipes in JavaScript check to see if a variable is falsy, and that undefined is a falsy value in JavaScript, e.g. It means that if the value is falsey (e.g. 0, "", null, un...
Mraz asked 26/9, 2017 at 10:32

© 2022 - 2024 — McMap. All rights reserved.