Comparison

Comparison operators are used to compare two variables, typically numbers.

Operators
The Lua core is capable of the following comparison operators:

Less than:  Compares the left variable to the right variable. Returns  if the left is less than the right, otherwise returns.

Greater than:  Compares the left variable to the right variable. Returns  if the left is greater than the right, otherwise returns

Less than or equals:  Compares the left variable to the right variable. Returns  if the left is greater than the right, otherwise returns. This is the logical opposite of the greater than operator.

Greater than or equals:  Compares the left variable to the right variable. Returns  if the left is less than the right, otherwise returns. This is the logical opposite of the less than operator.

Equals:  Compares the left variable to the right variable. Returns  if the two variables are equal, or   if they are not.

Not Equals:  Compares the left variable to the right variable. Returns  if the two variables are equal (a few exceptions, see special cases), or   if they are not. This is the logical opposite of the equals operator.

Special cases

 * NaN (Not a Number) is the only Lua value that is not equal to itself.
 * Table equality is by reference, not by value. This means that  is   because the two tables have different references/are at different locations in memory, even though they contain the same values. However,   is   as the reference is the same and they are considered the same table.
 * Comparison can be overriden using metamethods.