Does any language use "=/=" for denoting the not-equal operator

Erlang uses it to denote exactly not equal to.

Also generally there shouldn't be any difficulties for scanners to recognize such a token (proof by example: Erlang ;-)


  1. Not one of the mainstream ones. One could easily create such a language, however.
    • (As others have mentioned, Erlang and a few other languages do have it already)
  2. Nope. Unless you have a really weird language, there's nothing special about this operator in terms of lexical analysis.

By the way, Java has:

  • > (greater than)
  • >> (signed right shift)
  • >>= (signed right shift compound assignment)
  • >>> (unsigned right shift)
  • >>>= (unsigned right shift compound assignment)
  • > (closing generic type parameter, nestable)
    • >>, >>>, >>>>, ...

and they all work just fine.

Related question

  • What trick does Java use to avoid spaces in >> ?

Yes, Erlang uses this symbol as one of its representations for "not equal".

Erlang is a language with strong support for concurrency, originally designed within Ericsson and used for writing software for telephone exchanges, but now gaining significant popularity outside.


In Erlang =/=, as noted by Bytecode Ninja means "exactly not equal to". The notation of Erlang is strongly influenced by Prolog so it should come as no surprise that Prolog uses that operator too. There are several languages which make defining operators trivial. Haskell would be one such. =/= isn't defined in the Haskell standard, but defining it would be trivial:

(=/=) x y = ....

This could then be used in function call-like syntax:

(=/=) 5 6

Or as an inline operator:

5 =/= 6

The semantics would depend on the implementation, of course.

I think that Common Lisp weenies users could write some kind of reader macro that used that sequence too, but I'm not positive.