Skip to main content

Questions tagged [logical-operators]

The tag has no usage guidance.

1 vote
2 answers
429 views

Is it necessary to differentiate between && and & when I support overloads [closed]

It is an old tradition in programming languages to use & and | to represent bitwise operations, and ...
Aster's user avatar
  • 3,238
9 votes
5 answers
1k views

How to make logical operators that return operands consistent in a statically typed language?

In C++, 3 || 4 returns true. But in Python, 3 or 4 returns 3 instead. That's a logical operator that returns its operand. I don'...
user23013's user avatar
  • 2,588