Questions tagged [negation]

Negation is the logic operation that inverses a value, also seen as a NOT operation. Functions in specific languages may operate with negation to specific uses. For questions specific to the use of complement patterns in regular expressions, use [regex-negation] instead.

Negation is the logic operation that inverses a value, also seen as a NOT operation. Negation may be implemented by specific languages to provide functions capable of operating with values for specific uses.

Read also the wikipedia article on Negation.

248 questions
-2
votes
1 answer

Event delegation .on('click') and the css negation :not()

I am trying to create an event delegation for a dynamically added/removed class. I am creating an event for specific elements that are clicked and don't have that class added to them. Here's my line of code but it's not working. Is my syntax wrong?…
Nikolay
  • 225
  • 5
  • 12
-2
votes
1 answer

Finding the character "^" using regex

I'm trying to define a regex pattern that searches for a caret character, but since ^ is used for negation, I'm not sure how to define the pattern. I'm trying to make the program find a string that is a letter then a caret then a number (as you may…
Shubhang Desai
  • 329
  • 3
  • 17
-2
votes
1 answer

complement/negation doesn't work right

hello i wrote a small program to demonstrate the problem that i'm facing long n; n = 1; //1=0001 //2=0010 //-2=1101 Console.WriteLine(n+" "+ ~n); Console.WriteLine(n+~n); and the output is something like this : 1 -2 -1 as i know ~ sign…
Mohammad Hossein Amri
  • 1,842
  • 2
  • 23
  • 43
-3
votes
1 answer

Unexpected Output of c program

void main() { clrscr(); if(sizeof(!6.0)) printf("%d",sizeof(6.0,2)); else printf("i don't know"); getch(); } The output of this function is 4. As I can understand in the expression if(sizeof(!6.0)) -> the…
-3
votes
2 answers

What's the meaning of !int_variable--?

I can't understand what the following code is doing on s: if(!s--) s is an int
Dome.paol
  • 7
  • 2
-4
votes
1 answer

Why does negation comparison in IF statement invokes a method

I have following code if ( !handleOptions(args) ) { return false; } if ( !initConfig() ) { logger.error("Error initializing configuration. Terminating"); return false; } And the code itself is self explaining…
Lone_Wanderer
  • 179
  • 1
  • 3
  • 16
-5
votes
2 answers

c# meaning of ! before a statement

i am writing an application someone could help me with just giving me sample code ! i'm stuck in this place ! any one have any ideas ? bool bl = false; using (StreamReader reader = new StreamReader(response.GetResponseStream())) bl =…
MdSalehGh
  • 41
  • 1
  • 8
-10
votes
3 answers

what is the difference between 'AND' operator and 'OR' operator in c

#include int main() { int a; int count; char ch; for(a=1;a<=100;a++) { printf("%d\n",a); printf("do you want to break loop(y/n):"); scanf(" %c",&ch); if(ch=='y' || ch=='Y') …
senise
  • 1
  • 2
1 2 3
16
17