tagged [operators]
practical applications of bitwise operations
practical applications of bitwise operations 1. What have you used bitwise operations for? 2. why are they so handy? 3. can someone please recommend a VERY simple tutorial?
- Modified
- 7 Oct at 15:44
Why does >= return false when == returns true for null values?
Why does >= return false when == returns true for null values? I have two variables of type int? (or Nullable if you will). I wanted to do a greater-than-or-equal (>=) comparison on the two variables ...
- Modified
- 9 Dec at 16:36
why -3==~2 in C#
why -3==~2 in C# Unable to understand. Why output is "equal"
- Modified
- 18 Dec at 00:13
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
Greater than and less than in one statement
Greater than and less than in one statement I was wondering, do you have a neat way of doing this ? ``` if(orderBean.getFiles().size() > 0 && orderBean.getFiles().size() 0 && filesCount
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`.
Is relying on && short-circuiting safe in .NET?
Is relying on && short-circuiting safe in .NET? Assume myObj is null. Is it safe to write this? I know some languages won't execute the second expression because the && evaluates to false before the ...
- Modified
- 27 Jan at 19:22
Python's 'in' operator equivalent to C#
Python's 'in' operator equivalent to C# With Python, I can use 'in' operator for set operation as follows : What's the equivalent in C#?
Does c# ?? operator short circuit?
Does c# ?? operator short circuit? When using the `??` operator in C#, does it short circuit if the value being tested is not null? Example: Does the test3 line succeed or throw a null reference excep...
- Modified
- 15 Mar at 22:36
Operator overloading?
Operator overloading? I've made myself a rss reader that keeps me up to date and informs me on new shows, or atleast thats the thought behind. I've made a struct "SeasonEpisode" that hold two ints (se...
Does anyone know of a .NET enum of Comparison Operators in System or System.Core?
Does anyone know of a .NET enum of Comparison Operators in System or System.Core? Is there an enum in System or System.Core that has all the ComparisonOperators? I just wrote the following enum, but i...
- Modified
- 28 Apr at 14:53
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 ...
proper name for python * operator?
proper name for python * operator? What is the correct name for operator `*`, as in `function(*args)`? unpack, unzip, something else?
xor with 3 values
xor with 3 values I need to do an xor conditional between 3 values, ie i need one of the three values to be true but not more than one and not none. I thought i could use the xor ^ operator for this b...
- Modified
- 3 Jun at 14:19
No increment operator in VB.net
No increment operator in VB.net I am fairly new to vb.net and came across this issue while converting a for loop in C# to VB.net I realized that the increment operators are not available in vb.net (++...
C# interface cannot contain operators
C# interface cannot contain operators Can anyone please explain why C# interfaces are not allowed to contain operators? Thanks.
- Modified
- 7 Jul at 00:40
Operator '=' chaining in C# - surely this test should pass?
Operator '=' chaining in C# - surely this test should pass? I was just writing a property setter and had a brain-wave about why we don't have to `return` the result of a `set` when a property might be...
- Modified
- 12 Jul at 16:1
Why are Postfix ++/-- categorized as primary Operators in C#?
Why are Postfix ++/-- categorized as primary Operators in C#? Currently I'm teaching a class of C++ programmers the basics of the C# language. As we discussed the topic operators I used C# standard ca...
- Modified
- 13 Aug at 13:55
How do I perform explicit operation casting from reflection?
How do I perform explicit operation casting from reflection? I want to use reflection and do either an implicit or explicit coversion using reflection. Given I have defined Foo this way ``` public cla...
- Modified
- 8 Sep at 16:19
C# Error: The call is ambiguous between the following methods or properties. Overloading operators
C# Error: The call is ambiguous between the following methods or properties. Overloading operators I have 2 classes with overloaded operators in a namespace called Dinero, these are the 2 classes: Fir...
- Modified
- 18 Oct at 21:11
How to verify whether a type overloads/supports a certain operator?
How to verify whether a type overloads/supports a certain operator? How can I check whether a certain type implements a certain operator? ``` struct CustomOperatorsClass { public int Value { get; pr...
- Modified
- 15 Dec at 16:9
Using the ternary operator for multiple operations
Using the ternary operator for multiple operations How can I use the ternary `? :` condition to perform multiple operations, if expression is true/false? `wbsource = (exp) ? (Do one thing) : (Do secon...
What is the instanceof operator in JavaScript?
What is the instanceof operator in JavaScript? The `instanceof` keyword in JavaScript can be quite confusing when it is first encountered, as people tend to think that JavaScript is not an object-orie...
- Modified
- 10 Apr at 20:46
Difference between "and" and && in Ruby?
Difference between "and" and && in Ruby? What is the difference between the `&&` and `and` operators in Ruby?