!(10<count)

Nov 3, 2008 at 4:58pm
Evening all...

I'm just reading a book which is demonstrating how you can link any number of relational operations together using logical operators, and the book gives this example:

var > 15 || !(10 < count) && 3 <= item

I understand that well enough, but I just wondered - would you ever need to write !(10 < count) or could you just write 10 > count ?

If the first one means "not '10 is less than count'", does not "10 is greater than count" give you exactly the same meaning? Or not in this case?
Nov 3, 2008 at 5:10pm
actually, I believe !(10 < count) is the same as (10>=count)
Nov 3, 2008 at 5:11pm
!( 10 < count ) isn't the same as 10 > count but should be the same as writing 10 >= count
Nov 3, 2008 at 5:28pm
Oops! Of course it is... Thanks for that, chaps...
Topic archived. No new replies allowed.