^ operator

  • Thread starter Thread starter Berryl Hesh
  • Start date Start date
Pavel said:
They do know the tables. My point is that in C, ^ is always bitwise,
never proper boolean (and you might want to consider why there wasn't
^^ analogous to || and &&). Not that many people with C background
know that in C#, ^ actually works on boolean values the way you'd
expect it to do.

There can NEVER be a ^^ as it is impossible to evaluate a xor term
without looking at both operands!
The funny thing about && and || is that they stop evaluating if the
first operand is satisfactory to know the result.

PS: I like ^, too... ;-)
 
Stefan said:
There can NEVER be a ^^ as it is impossible to evaluate a xor term
without looking at both operands!
The funny thing about && and || is that they stop evaluating if the
first operand is satisfactory to know the result.

In C# the short-circuit is the primary difference between & and &&, the
original behavior in C (and matching behavior in C++ and probably also Java
and ECMAScript) other differences are at least as important.
 
Back
Top