?

Log in

No account? Create an account
 
 
06 May 2012 @ 09:51 am
Posting this here so there's a stationary URL I can point to  
I'm getting tired of typing out "is not the same as" or "is not equal to", so I'm going to start using the mathematical symbol !=

This post will serve as my explanation whenever someone asks what the heck that means. Feel free to use it too. =)
 
 
 
Idtechnomonkey on May 6th, 2012 04:51 pm (UTC)
For those who want it...
some guy: wary unblinking blue guyself on May 6th, 2012 06:59 pm (UTC)
huh. we still have LJ accounts.

This one's less likely to catch on, but = != ==

  • == tests two values to see if they're equal.
  • = is an assignment, not a test. it causes things things to be equal "because I said so".

so...
x = 1. if (x = 3) then I used the wrong operator. x == 3.

In practical terms, a journalist uses == in most of their assertions, where CNN and Fox News use = in nearly every statement.


And then if you really want to get obnoxious about it, == != ===

  • === tests not only whether the value of two variables are equal, but also whether they're equivalent.
    Two apples aren't really equal to two oranges (nor two PCs).

In programming terms, we use that because [print "100"] and [print 100] both result in "100" being printed, but where [print 100 + 1] results in "101" being printed, [print "100" + "1"] results in "1001" being printed. If we don't test our assumptions, bad things transpire.

This is all oversimplifying, really. We don't have nearly enough symbols to identify all of these...