tagged [operators]
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:
- Modified
- 29 Apr at 19:23
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...
- Modified
- 19 Apr at 16:15
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...
- Modified
- 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 ...
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`
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...
- Modified
- 5 Feb at 19:0
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...
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?
- Modified
- 9 Nov at 14:31
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...
- Modified
- 1 Nov at 13:1
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...
- Modified
- 2 Oct at 11:40
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...
- Modified
- 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...
- Modified
- 17 Aug at 18:40
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...
- Modified
- 22 Jul at 14:59
Difference between >>> and >>
Difference between >>> and >> What is the difference between `>>>` and `>>` operators in Java?
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-...
- Modified
- 26 Mar at 14:14
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?
- Modified
- 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 ...
Why are there no ++ and -- operators in Python?
Why are there no ++ and -- operators in Python? Why are there no `++` and `--` operators in Python?
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...
- Modified
- 27 Sep at 11:39
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...
- Modified
- 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 `
- Modified
- 25 Jul at 11:43
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
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...
- Modified
- 29 Jun at 16:54
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...
- Modified
- 25 Jun at 12:44