— Not Equal To [!=]

The Not Equal To [!=] test is another logical operation on a comparison.

Remember how the NOT operator [!] flips the truth value?

Well that’s what happens with the not equal to.

For example:

3 != 3

is the same as !( 3 == 3)

Since 3 == 3 is true, !(3==3) is false,

so 3!=3 is false.

5!=3

is the same as !(5==3)

since 5==3 is false, !(5==3) is true,

so 5!=3 is true.

This is good enough for what we need. But if you want to get super-mathy with it click HERE.

NEXT: Branching

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s