tagged [operators]

How can I calculate divide and modulo for integers in C#?

How can I calculate divide and modulo for integers in C#? How can I calculate division and modulo for integer numbers in C#?

16 May at 19:27

What is the difference between '/' and '//' when used for division?

What is the difference between '/' and '//' when used for division? Is there a benefit to using one over the other? In Python 2, they both seem to return the same results:

Is there an exponent operator in C#?

Is there an exponent operator in C#? For example, does an operator exist to handle this? In the past the `^` operator has served as an exponential operator in other languages, but in C# it is a bit-wi...

Is a += 5 faster than a = a + 5?

Is a += 5 faster than a = a + 5? I'm currently learning about operators and expressions in C# and I understood that if I want to increment the value of a variable by 5, I can do it in two different wa...

1 Apr at 11:5

C# - what does the unary ^ do?

C# - what does the unary ^ do? I have checked out some code and I got an error ('invalid expression term "^"' to be exact) in the line I have never seen a unary caret operator (I am only aware of the ...

3 Mar at 08:8

What does mean "?" after variable in C#?

What does mean "?" after variable in C#? What does this condition mean? P.S. - `helper``class`- `Settings`- `HasConfig`

13 Feb at 13:6

Execution order of conditions in C# If statement

Execution order of conditions in C# If statement There are two if statements below that have multiple conditions using logical operators. Logically both are same but the order of check differs. The fi...

Not equal to != and !== in PHP

Not equal to != and !== in PHP I've always done this: `if ($foo !== $bar)` But I realized that `if ($foo != $bar)` is correct too. Double `=` still works and has always worked for me, but whenever I s...

12 Dec at 19:19

Difference between == and === in JavaScript

Difference between == and === in JavaScript What is the difference between `==` and `===` in JavaScript? I have also seen `!=` and `!==` operators. Are there more such operators?

How to check if the string is empty?

How to check if the string is empty? Does Python have something like an empty string variable where you can do: Regardless, what's the most elegant way to check for empty string values? I find hard co...

Is it possible define an extension operator method?

Is it possible define an extension operator method? is it possible to define an extension method that at the same time is an operator? I want for a fixed class add the possibility to use a known opera...

Detecting negative numbers

Detecting negative numbers I was wondering if there is any way to detect if a number is negative in PHP? I have the following code: I need to find out if `$profitloss` is negative and if it is, I need...

26 Sep at 20:26

Is there a “not in” operator in JavaScript for checking object properties?

Is there a “not in” operator in JavaScript for checking object properties? Is there any sort of "not in" operator in JavaScript to check if a property does not exist in an object? I couldn’t find anyt...

Use of "instanceof" in Java

Use of "instanceof" in Java > [What is the 'instanceof' operator used for?](https://stackoverflow.com/questions/7313559/what-is-the-instanceof-operator-used-for) I learned that Java has the `instance...

22 Jul at 14:59

Difference between >>> and >>

Difference between >>> and >> What is the difference between `>>>` and `>>` operators in Java?

3 Jul at 02:21

What is the difference between & and && in Java?

What is the difference between & and && in Java? I always thought that `&&` operator in Java is used for verifying whether both its boolean operands are `true`, and the `&` operator is used to do Bit-...

Using the && operator in an if statement

Using the && operator in an if statement I have three variables: How to use and (`&&`) operator in if statement like this: When I write this code it gives error. What is the right way?

24 Mar at 18:38

C# LINQ Orderby - How does true/false affect orderby?

C# LINQ Orderby - How does true/false affect orderby? I was studying a bit of LINQ ordering as I have a list of Ids, and I need to order them sequentially. However, there are certain ids that need to ...

2 Feb at 14:40

Why are there no ++ and --​ operators in Python?

Why are there no ++ and --​ operators in Python? Why are there no `++` and `--` operators in Python?

9 Dec at 13:36

Boolean operators && and ||

Boolean operators && and || According to the [R language definition](https://cran.r-project.org/doc/manuals/r-release/R-lang.html#Operators), the difference between `&` and `&&` (correspondingly `|` a...

How do you get the logical xor of two variables in Python?

How do you get the logical xor of two variables in Python? How do you get the [logical xor](http://en.wikipedia.org/wiki/Exclusive_or) of two variables in Python? For example, I have two variables tha...

24 Aug at 13:20

How do I overload an operator for an enumeration in C#?

How do I overload an operator for an enumeration in C#? I have an enumerated type that I would like to define the `>`, `=`, and `

What does the percentage sign mean in Python

What does the percentage sign mean in Python In the tutorial there is an example for finding prime numbers: I under

7 Jul at 10:35

How to call custom operator with Reflection

How to call custom operator with Reflection In my small project I'm using `System.Reflection` classes to produce executable code. I need to call the `+` operator of a custom type. Does anybody know ho...

Handlebarsjs check if a string is equal to a value

Handlebarsjs check if a string is equal to a value Is it possible in Handlebars to check if a string is equal to another value without registering a helper? I can't seem to find anything relevant to t...