Relational Operators

Equality (==) first compares the tags of its operands. If they are different, then the result is nil . Otherwise, their values are compared.Numbers and strings are compared in the usual way. Tables, userdata, and functions are compared by reference. The operator ~= is exactly the negation of equality (==). Coercion rules (conversion between strings and numbers) do not apply to equality comparisons. The exact behaviour of the order operators (< > <= >=) can be found in the description for the lt tag method.