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 "="?

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"...

1 Jul at 11:54

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 +?

11 Jul at 17:33

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:

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...

26 Mar at 16:20

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?

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?

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?

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?

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 ...

9 May at 19:41

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

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`.

18 Jan at 17:19

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

== vs Equals in C#

== vs Equals in C# What is the difference between the evaluation of == and Equals in C#? For Ex, but Edited:

19 Mar at 14:47

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?

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...

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...

23 May at 12:23

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...

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...

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

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 ...

23 Jul at 08:5

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...

15 Jan at 06:28

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...

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...

23 May at 11:54