Questions tagged [logical-operator]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
2answers
314 views

Any reason to not use a triple not?

If logical not ! will switch a boolean value from false to true or true to false and a double not !! will cast a value from one primitive type to boolean is there any reason one can not use a logical ...
3
votes
2answers
276 views

Conditional vs Logical Testing

I would like to get your code thought and views on using conditional vs logical testing. For example: To test the conditions of truthness of all of the following variables, their currect status is ...
62
votes
3answers
10k views

&& and || are not logical but conditional operators?

I am a bit confused by the MSDN C# documentation which states that & and | are logical operators and that && and || are conditional operators. I keep calling &&, || and ! logical ...
5
votes
4answers
619 views

Why is there both logical operators <> and !=?

The are two operators '<>' and '!=' used in programming languages with the same general meaning. '<>' can be used in PHP, SQL, and Pascal. '!=' seems to be more commonly used. What is the ...
-3
votes
3answers
162 views

Was there some language(s) in which its logical operators returning a true or false only?

I remember in the past, for some languages which I can't remember, be it Fortran, Pascal, or Scheme, a logical operator 2 || 3 will always return a boolean value. But in the modern languages: ...