tagged [operators]
What does the "&=" in this C# code do?
What does the "&=" in this C# code do? I came across some code that looks like this: Why would I use the bitwise operator instead of "="?
- Modified
- 29 Dec at 16:56
What's the difference between “mod” and “remainder”?
What's the difference between “mod” and “remainder”? My friend said that there are differences between "mod" and "remainder". If so, what are those differences in C and C++? Does '%' mean either "mod"...
Why is x++-+-++x legal but x+++-+++x isn't?
Why is x++-+-++x legal but x+++-+++x isn't? I'm wondering why in C# the following is fine: But Isn't? Why is there a bias against the +?
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
What are true and false operators in C#?
What are true and false operators in C#? What is the purpose and effect of the `true` and `false` in C#? The [official documentation](http://msdn.microsoft.com/en-us/library/eahhcxk2(VS.71).aspx) on t...
Is there a conditional ternary operator in VB.NET?
Is there a conditional ternary operator in VB.NET? In Perl (and other languages) a conditional ternary operator can be expressed like this: Is there a similar operator in VB.NET?
- Modified
- 28 Mar at 13:40
throwing an exception if an object is null
throwing an exception if an object is null I've recently discovered that: can be rewritten as Can the following be rewritten in a similar fashion?
- Modified
- 18 Feb at 01:25
How do I get a decimal value when using the division operator in Python?
How do I get a decimal value when using the division operator in Python? For example, the standard division symbol '/' rounds to zero: However, I want it to return 0.04. What do I use?
- Modified
- 30 Oct at 00:9
Batch not-equal (inequality) operator
Batch not-equal (inequality) operator According to [this](http://tldp.org/LDP/abs/html/dosbatch.html), `!==!` is the not-equal string operator. Trying it, I get: What am I doing wrong?
- Modified
- 18 Sep at 18:30
programmatically specify operator
programmatically specify operator Is it possible to specify an operator `R` where `R` can be an arithmetic, relational or logical operator ? For example a function that calculates where I can specify ...
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
IS NOT operator in C#
IS NOT operator in C# I can't find the "is not" operator in C#. For example I have the code below which does not work. I need to check that `err` is not of type class `ThreadAbortException`.
What do two left angle brackets mean?
What do two left angle brackets mean? I saw a loop which I've never seen before: ``` for (int i = 0; i
- Modified
- 1 Feb at 14:23
== vs Equals in C#
== vs Equals in C# What is the difference between the evaluation of == and Equals in C#? For Ex, but Edited:
Why does negating a value change the result when XORing it with 1?
Why does negating a value change the result when XORing it with 1? I know the working of XOR, results to but how does this return 2?
- Modified
- 5 May at 10:15
Why are there no ||= or &&= operators in C#?
Why are there no ||= or &&= operators in C#? We have equivalent assignment operators for all Logical operators, Shift operators, Additive operators and all Multiplicative operators. Why did the logica...
- Modified
- 15 Nov at 23:53
What are the | and ^ operators used for?
What are the | and ^ operators used for? > [What are bitwise operators?](https://stackoverflow.com/questions/276706/what-are-bitwise-operators) Recently I came across a few samples that used the | a...
- Modified
- 26 Nov at 10:29
C# Nullable Equality Operations, Why does null <= null resolve as false?
C# Nullable Equality Operations, Why does null = null null == null ``` resolves as true? In other words, why isn't `null >= null` equivalent to `null > null || null == null`? Does anyone have the offi...
- Modified
- 30 Mar at 15:16
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
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
What is the difference between the | and || or operators?
What is the difference between the | and || or operators? I have always used `||` (two pipes) in OR expressions, both in C# and PHP. Occasionally I see a single pipe used: `|`. What is the difference ...
How to use greater than operator with date?
How to use greater than operator with date? No idea what is going on here. Here is the query, right from phpMyAdmin: ``` SELECT * FROM `la_schedule` WHERE 'start_date' >'2012-11-18'; ``` But I consist...
Why nullable int (int?) doesn't increase the value via "+=" if the value is NULL?
Why nullable int (int?) doesn't increase the value via "+=" if the value is NULL? I have a page counter type of int?: It works ONLY if the value of ViewCount property is (any int). Why the compiler do...
- Modified
- 30 Jul at 09:53
No increment operator (++) in Ruby?
No increment operator (++) in Ruby? > [Why doesn't Ruby support i++ or i— for fixnum?](https://stackoverflow.com/questions/3660563/why-doesnt-ruby-support-i-or-i-for-fixnum) Why is there no incremen...