y); } Though Java and C# have the same operators as C, this mistake usually causes a compile error in these languages instead, because the if-condition must be of type boolean, and there is no implicit way to convert from other types (e.g., numbers) into booleans. So unless the variable that is assigned to has type boolean (or wrapper type Boolean), there will be a compile error. In ALGOL-like languages such as Pascal, Delphi, and Ada (in the sense that they allow nested function definitions), and in Python, and many functional languages, among others, assignment operators cannot appear in an expression (including if clauses), thus precluding this class of error. Some compilers, such as GNU Compiler Collection (GCC), provide a warning when compiling code containing an assignment operator inside an if statement, though there are some legitimate uses of an assignment inside an if-condition. In such cases, the assignment must be wrapped in an extra pair of parentheses explicitly, to avoid the warning. Similarly, some languages, such as BASIC use just the = symbol for both assignment and equality, as they are syntactically separate (as with Pascal, Ada, Python, etc., assignment operators cannot appear in expressions). Some programmers get in the habit of writing comparisons against a constant in the reverse of the usual order: if (2 == a) { /* Mistaken use of = versus == would be a compile-time error */ } If = is used accidentally, the resulting code is invalid because 2 is not a variable. The compiler will generate an error message, on which the proper operator can be substituted. This coding style is termed left-hand comparison, or Yoda conditions. This table lists the different mechanisms to test for these two types of equality in various languages: Ruby uses a === b to mean "b is a member of the set a", though the details of what it means to be a member vary considerably depending on the data types involved. === is here known as the "case equality" or "case subsumption" operator. See also Binary relation Common operator notation Conditional (computer programming) Equality (mathematics) Equals sign Logical operator Operation (mathematics) Operator (mathematics) Operator (computer programming) Spaceship operator Triadic relation Notes and references Operators (programming) Binary operations Comparison (mathematical) Articles with example C code