Posting this here so there's a stationary URL I can point to

May 06, 2012 09:51

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. =)

Leave a comment

Comments 2

For those who want it... technomonkey May 6 2012, 16:51:50 UTC
huh. we still have LJ accounts. self May 6 2012, 18:59:45 UTC

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...

Reply


Leave a comment

Up