tagged [operators]

C# bitwise rotate left and rotate right

C# bitwise rotate left and rotate right What is the C# equivalent (.NET 2.0) of `_rotl` and `_rotr` from C++?

15 Jan at 17:25

What does question mark and dot operator ?. mean in C# 6.0?

What does question mark and dot operator ?. mean in C# 6.0? With C# 6.0 in the VS2015 preview we have a new operator, `?.`, which can be used like this: What exactly does it do?

31 Oct at 20:52

?: Operator Vs. If Statement Performance

?: Operator Vs. If Statement Performance I've been trying to optimize my code to make it a little more concise and readable and was hoping I wasn't causing poorer performance from doing it. I think my...

Conditional XOR?

Conditional XOR? How come C# doesn't have a conditional `XOR` operator? Example:

12 Aug at 09:23

C# bitwise equal bool operator

C# bitwise equal bool operator Boolean in C# are 1 byte variables. And because bool are shortcuts for the Boolean class, I would expect that the , operations have been overridden to let them work with...

Why does the C# compiler translate this != comparison as if it were a > comparison?

Why does the C# compiler translate this != comparison as if it were a > comparison? I have by pure chance discovered that the C# compiler turns this method: …into this [CIL](http://en.wikipedia.org/wi...

19 Jul at 08:30

Is this big complicated thing equal to this? or this? or this?

Is this big complicated thing equal to this? or this? or this? Let's say I'm working with an object of class `thing`. The way I'm getting this object is a bit wordy: I'd like to see if this `thing` is...

7 Jun at 03:9

What's the difference between & and && in MATLAB?

What's the difference between & and && in MATLAB? What is the difference between the `&` and `&&` logical operators in MATLAB?

What does the ?. mean in C#?

What does the ?. mean in C#? From the project `Roslyn`, file `src\Compilers\CSharp\Portable\Syntax\CSharpSyntaxTree.cs` at line `446` there is: What is the `?.` there? Does it check whatever oldTree i...

18 Apr at 19:27

SQL Logic Operator Precedence: And and Or

SQL Logic Operator Precedence: And and Or Are the two statements below equivalent? and Is there some sort of truth table I could use to verify this?

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

Do short-circuiting operators || and && exist for nullable booleans? The RuntimeBinder sometimes thinks so

Do short-circuiting operators || and && exist for nullable booleans? The RuntimeBinder sometimes thinks so I read the C# Language Specification on the `||` and `&&`, also known as the short-circuiting...

Bitwise operation and usage

Bitwise operation and usage Consider this code: ``` x = 1 # 0001 x

If the left operand to the ?? operator is not null, does the right operand get evaluated?

If the left operand to the ?? operator is not null, does the right operand get evaluated? I'm looking at using the `??` operator (null-coalescing operator) in C#. But the [documentation](http://msdn.m...

4 Oct at 16:9

What does the question mark in member access mean in C#?

What does the question mark in member access mean in C#? Can someone please explain to me what does the question mark in the member access in the following code means? Is it part of standard C#? I get...

1 Oct at 13:35

What does ||= (or-equals) mean in Ruby?

What does ||= (or-equals) mean in Ruby? What does the following code mean in Ruby? Does it have any meaning or reason for the syntax?

9 Sep at 22:21

What's the difference between equal?, eql?, ===, and ==?

What's the difference between equal?, eql?, ===, and ==? I am trying to understand the difference between these four methods. I know by default that `==` calls the method `equal?` which returns true w...

8 Sep at 16:34

What does the ++ (or --) operator return?

What does the ++ (or --) operator return? While playing around with the `++` operator, I tried to write the following: I expected this to compile at first, but I got a compiler error: > The operand of...

24 Jul at 02:7

How can "x & y" be false when both x and y are true?

How can "x & y" be false when both x and y are true? ## Context: I'm learning C# and have been messing about on the [Pex for fun](http://pexforfun.com/) site. The site challenges you to re-implement a...

Using a custom F# operator in C#?

Using a custom F# operator in C#? I've stumbled upon the fact that it's possible to define custom operators in F#. Also, I believe it's possible to reuse F# code in C#. Is it possible to create a cust...

9 Apr at 05:31

Which is faster? ++, += or x + 1?

Which is faster? ++, += or x + 1? I am using C# (This question is also valid for similar languages like C++) and I am trying to figure out the fastest and most efficient way to increment. It isn't jus...

11 Mar at 17:58

Is there a "null coalescing" operator in JavaScript?

Is there a "null coalescing" operator in JavaScript? Is there a null coalescing operator in Javascript? For example, in C#, I can do this: The best approximation I can figure out for Javascript is usi...

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

Implicit (bool) and == operator override - handle if statements correctly

Implicit (bool) and == operator override - handle if statements correctly I have a custom class with implement both the `==` and the `implicit` for boolean operator. Is this the correct way to handle ...

31 Jan at 16:55