# LaVOZs

The World’s Largest Online Community for Developers

'; Newest 'logical-operators' Questions - LavOzs.Com

# Questions tagged [logical-operators]

Logical operators are symbols that aid in evaluating boolean expressions. These are found in just about every programming language that supports boolean. Common examples are && (AND), || (OR), ! (NOT), == ([value] equal to), === ([value and type] equal to), >= (Greater than or equal to), <= (Less than or equal to), > (Greater than), and < (less than)

• ### Why does if statement always goes to else whenever I'm running this type of code: [duplicate]

import java.util.Scanner; public class sampleCode { public static void main(String[] args) { String a = "a. Hello"; String b = "b. Goodbye"; System.out.println("Make ...
• ### How to detect duplicates in the results of lambda functions?

We are working with a rule engine that is based on lambda functions. Each function is instantiated with type: Func<Term, bool> Every function consumes an object of type Term and returns a ...
• ### Why (true && true) raise an error while (1 && 1) doesn't? [duplicate]

I thought that C interpreted true as 1 but now I'm having doubts. Full code (compiled with GCC 5.1): if(true && true) // Error: 'true' undeclared (first use in this function) { } Why does ...
• ### If we have three logical inputs A, B, C generating: (A'B+AC) and (AB+A'C), is there any way we can generate A from the two output?

So we have three inputs A, B, C generating the following: output1: A'B + AC and output2: AB + A'C Can we, using some logical gates obtain the input A from the two outputs?
• ### Programmatically define Python operators such as & or |

is it possible to define programmatically some Python operators like & or |? Something like the below would be ideal logical_op = '|' var1 = var2 = True eval(f'var1 {logical_op} var2') eval ...
• ### Trying logical comparisons in bash

I am just trying to get something straight as to why the following returns false: echo \$[ \$(( 2100%4 )) == 0 ] --> returns '1' I know I am probably missing something simple.
• ### Why is NA | FALSE = NA? [duplicate]

I first wondered why FALSE | NA returns #> [1] NA, while TRUE | NA returns #> [1] TRUE. Then I read the explanation that "because the value of the missing element matters in NA | FALSE, ...
• ### artificial neural networks `xnor` gate

We construct an artificial neural network for the XOR function in class as follows I would like to construct XNOR (the negation of XOR) next. Should I just play around with the weights, or is it ...
• ### Can someone explain this strange behavior of R's logical test results? [duplicate]

I have run into seemingly inconsistent results while using different combinations of logical tests in R. Here is a reproducible example: x <- NA y <- 1 is.na(x) # evaluates to TRUE x == 2 # ...
• ### converting a string into false Boolean value

I want to know how I can get a string value to convert into a False bool value, because every time I run the code it returns a True value. high_income = input(“Do you have a high income?:”) credit = ...
• ### Javascript - Is there a clearer way to express “if (a && b || !a && !b)”?

Would like to express "if both/neither a and/nor b are true", i.e. the boolean values of a and b are the same
• ### Result of bitwise OR operator in c

I have a question about bitwise OR | operator from c to rust. I have this lot of define to convert from c to rust, and i’m not sure of the flag SEFLG_ASTROMETRIC. #define SEFLG_JPLEPH 1 /* ...
• ### logical operators and if statements combination

I'm looking if there is an alternative to write this code cleaner and efficient. My goal is to set different values based on the hour of the day. var hour = new Date().getHours(); var user = 'User4'; ...
• ### Insert column based on logical conditions in R

I am selecting rows from my data based on either one of the conditions with the "filter" function: Subset_data <- filter(Data, company_type == 3 & annualturnover %in% c(1,2,3) | company_type ==...
• ### Ternary Operator with Logical Operators [closed]

I'm trying to use the logical operator && in my ternary operator while chaining and it isn't working... For example: (x === 5 && y === 5) ? (do something) : (x === 5 && ...