Home > Enterprise >  is !(count < 0) equal to (count > 0)
is !(count < 0) equal to (count > 0)

Time:06-03

As the title suggests, I'm wondering if these two are equal. I personally don't think they are because I understood the first part - !(count < 0) to be anything greater than or equal which isn't what the second expression is. I just want to make sure!

CodePudding user response:

!(count < 0) != (count > 0)

According to Boolean algebra: !(count < 0) == (count >= 0) which is != (count > 0)

CodePudding user response:

Plug it into your IDE and see what the result is

  • Related