<> == !=

At least, in humans' minds it should be - some pathetic languages, like BASIC, use <> when it should use !=, to mean "not equal to", like good languages do.

The <FILEHANDLE> operator in in perl, with a null FILEHANDLE. In general, this operator reads successive lines from the specified file. In perl, <> is magical, as it automagically reads from files specified on the command line, and then from stdin.

Many simple perl programs look like this:

while (<>) {
# do some processing

A relational operator that stands for "not equal to." This is used quite frequently in many programming languages. I know that Visual Basic, BASIC (thanx Ariels), and SQL use it. C, C++, Java, and others use !=, and the query builder I use at work on an AS/400 uses ne. In my unspectacular mathematics training, I've always seen it represented thus: ≠, an equal sign with a diagonal bar through it.

It may be read as "less than or greater than" since those symbols comprise it. If something is less than or greater than something else, logically they cannot be equal. Capiche?Thanks to spiregrain for suggesting this clarification.

Used in an expression in some languages, this operator yields a boolean result, i.e., true or false. In others, it returns an integer value that you can pretend is a boolean. I have seen return values of 0 and 1 but also 0 and -1. It depends. A mathematical example:

10 <> 10 would evaluate to false whereas
5 <> 10 would evaluate to true

You can represent these symbols in HTML by means of the following HTML symbol references: &lt;&gt; or &ne; or &#8800;.

Thanks to C-Dawg for the 411.

Log in or register to write something here or to contact authors.