Описание тега compare
The analysis required to assess the differences and similarities between two or more entities.
This tag is used to classify a question as one dealing with the comparison of at least two entities. The essence of questions that are tagged compare should boil down to one of the following questions:
- How do I control when the compiler/interpreter thinks that two entities are equal? How do I control when the compiler/interpreter thinks that two entities are unequal?
- How do I control when the compiler/interpreter thinks that one entity is bigger than the other?
- How do I control when the compiler/interpreter thinks that one entity is smaller than the other?
Note that in some languages, it is possible to define asymmetric inequalities. That is, cases in which a
<b
does not mean that b
<a
. This is why in python, there exist separate functions for __gt__
(greater than) and __lt__
(less than), etc