Computing.Net > Forums > Programming > NOT operator

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

NOT operator

Reply to Message Icon

Name: donever
Date: February 7, 2009 at 19:42:48 Pacific
OS: Windows xp
CPU/Ram: athlon 3g
Product: Custom / CUSTOM BUILD
Subcategory: General
Comment:

hello! Can someone help me with this please I'm a little bit confuse. Ok.is this two statement the same.

If Not shoe >= 12 then and
If shoe <= 12 then the same

thank you.



Sponsored Link
Ads by Google

Response Number 1
Name: Judago
Date: February 7, 2009 at 20:05:26 Pacific
Reply:

No they are not the same.

The first statement tests if shoe is not greater than or equal to 12; an equivilant to "if shoe < 12". The second statement tests if shoe is less than or equal to 12. The difference is that if shoe is 12 the first statement will return false and the second will return true.


0

Response Number 2
Name: donever
Date: February 8, 2009 at 16:04:52 Pacific
Reply:

Hello! I understand the logical operator but with the NOT, I don't get it.


If Not shoe >= 12 then <--- this statement say that if shoe is lesser than or equal to 12. correct me if I'm wrong.


If shoe <= 12 then <--- this is the same too right.


I don't understand how is
If Not shoe >= 12 then and
If shoe < 12 is the same <--- in this statement if I have 12 shoe then the statement is false. correct me if i am wrong.


0

Response Number 3
Name: Razor2.3
Date: February 8, 2009 at 17:15:34 Pacific
Reply:

If Not shoe >= 12 then <--- this statement say that if shoe is lesser than or equal to 12. correct me if I'm wrong.
Actually, it's true if shoe is less than 12, not if shoe equals 12.


0

Response Number 4
Name: donever
Date: February 8, 2009 at 19:55:10 Pacific
Reply:

the last time I check >= <--- this is a greater than or equal sign. I'm saying

If NOT decShoeSize >= 12 then
statement to execute.

did I just say if decShoeSize is lesser than or equal to 12 then execute the statement.


0

Response Number 5
Name: Razor2.3
Date: February 8, 2009 at 21:51:15 Pacific
Reply:

the last time I check >= <--- this is a greater than or equal sign.
Correct. And Not inverts it. So >= becomes <, whereas > would become <=. If you really don't want to believe us, you don't have to. Just do some tests and see the results.


0

Related Posts

See More



Response Number 6
Name: Judago
Date: February 9, 2009 at 00:41:37 Pacific
Reply:

I think the concept your failing to grasp is the inverted equals.

"I don't understand how is
If Not shoe >= 12 then and
If shoe < 12 is the same"

Now think if shoe is a number and is both not greater than and not equal 12 how can it be anything but a number that is less than 12?


0

Response Number 7
Name: klint
Date: February 9, 2009 at 11:19:31 Pacific
Reply:

What Judago says above makes perfect sense, but it can be slightly tricky to analyze if you haven't got a mathematical mind. If that is the case, then spend some extra time thinking very carefully above every minute detail of Judago's statement.

If you are "right-brained" instead of "left-brained" then you are probably thinking of the operators in terms of the English language. So, when you write

"if not shoe >= 12"

you may be thinking in terms of the English sentence "if the shoe is not greater than or equal to 12". Then you may be taking that as "if the shoe is not greater than 12, or if it is equal to 12". Beware, English is not an precise language, and it fails here. To analyze that properly,

"if not shoe >= 12"

is equivalent to

"if the shoe is neither greater than, nor equal to, 12"

So it can only be less than!


0

Response Number 8
Name: donever
Date: February 9, 2009 at 13:10:33 Pacific
Reply:

thank all for the help. I nail it! to me i see it this way, the NOT logical operator dictate the outcome. with that being said,

if NOT x >= 12 mean if x <12
(if x is not greater then or equal to 12, it is less then 12)

if NOT x <= 12 mean if x > 12
(if x is not lesser then or equal to 12, it is greater then 12)

I cannot said if NOT x >= 12 is the same as if x <=12 because NOT operator reverse the logical value of the condition.
Again thank all for the help. I really appreciated!


0

Sponsored Link
Ads by Google
Reply to Message Icon

remembering user inputs batch backup



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: NOT operator

How can I set this up ? www.computing.net/answers/programming/how-can-i-set-this-up-/3103.html

DOS command for 'Wait 5 seconds...' www.computing.net/answers/programming/dos-command-for-wait-5-seconds/11192.html

Blank space within an array www.computing.net/answers/programming/blank-space-within-an-array/8553.html