# Relational operator

comparisonComparecomparison operatorEquality (relational operator)Inequality operatorRelationaltwo consecutive equals signscomparativecompare instructionComparison (computer programming)
In computer science, a relational operator is a programming language construct or operator that tests or defines some kind of relation between two entities.wikipedia
144 Related Articles

### Boolean data type

booleanBoolean variableBoolean value
In programming languages that include a distinct boolean data type in their type system, like Pascal, Ada, or Java, these operators usually evaluate to true or false, depending on if the conditional relationship between the two operands holds or not.
In programming languages with a built-in Boolean data type, such as Pascal and Java, the comparison operators such as and are usually defined to return a Boolean value.

### Equality (mathematics)

equalityequalequalities
These include numerical equality (e.g., 5 = 5) and inequalities (e.g., 4 ≥ 3).
In computer programming, its computation from two expressions is known as comparison.

### Common Lisp

QuicklispANSI Common LispArmed Bear Common Lisp
Other conventions are less common: Common Lisp and Macsyma/Maxima use Basic-like operators except for inequality, which is in Common Lisp and in Macsyma/Maxima.
For example, the function takes a relational operator as an argument and key function as an optional keyword argument.

### Inequality (mathematics)

inequalityinequalitiesLess than
These include numerical equality (e.g., 5 = 5) and inequalities (e.g., 4 ≥ 3).

### Equals sign

equal sign=equality
ALGOL included a relational operator that tested for equality, allowing constructions like with essentially the same meaning of "=" as the conditional usage in mathematics.

### Yoda conditions

This coding style is termed left-hand comparison, or Yoda conditions.
The constant is written to the left of the comparison operator, and the variable whose value is being checked against the constant is written to the right.

### C Sharp (programming language)

C#Visual C#C# programming language
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, and there is no implicit way to convert from other types (e.g., numbers) into s. So unless the variable that is assigned to has type (or wrapper type ), there will be a compile error.

### Swift (programming language)

SwiftSwift 3Swift programming language

### Operator (computer programming)

operatoroperatorsOperator (programming)
In computer science, a relational operator is a programming language construct or operator that tests or defines some kind of relation between two entities.
*Relational operator

### Computer science

computer scientistcomputer sciencescomputer scientists
In computer science, a relational operator is a programming language construct or operator that tests or defines some kind of relation between two entities.

### Programming language

programming languageslanguagedialect
In computer science, a relational operator is a programming language construct or operator that tests or defines some kind of relation between two entities.

### Binary function

binarybinary operationscomposition
In computer science, a relational operator is a programming language construct or operator that tests or defines some kind of relation between two entities.

### Type system

dynamicstatictype checking
In programming languages that include a distinct boolean data type in their type system, like Pascal, Ada, or Java, these operators usually evaluate to true or false, depending on if the conditional relationship between the two operands holds or not.

### Pascal (programming language)

PascalPascal programming languageISO 7185
In programming languages that include a distinct boolean data type in their type system, like Pascal, Ada, or Java, these operators usually evaluate to true or false, depending on if the conditional relationship between the two operands holds or not.

In programming languages that include a distinct boolean data type in their type system, like Pascal, Ada, or Java, these operators usually evaluate to true or false, depending on if the conditional relationship between the two operands holds or not.

### Java (programming language)

JavaJava programming languageJava language
In programming languages that include a distinct boolean data type in their type system, like Pascal, Ada, or Java, these operators usually evaluate to true or false, depending on if the conditional relationship between the two operands holds or not. 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, and there is no implicit way to convert from other types (e.g., numbers) into s. So unless the variable that is assigned to has type (or wrapper type ), there will be a compile error.

### Operand

operandsimmediate
In programming languages that include a distinct boolean data type in their type system, like Pascal, Ada, or Java, these operators usually evaluate to true or false, depending on if the conditional relationship between the two operands holds or not.

### C (programming language)

CC programming languageC language
In languages such as C, relational operators return the integers 0 or 1, where 0 stands for false and any non-zero value stands for true.

### Expression (computer science)

expressionexpressionsevaluation environment
An expression created using a relational operator forms what is termed a relational expression or a condition.

### Predicate (mathematical logic)

predicatepredicatespredication
Relational operators can be seen as special cases of logical predicates.

### Set (abstract data type)

setsetsset data structure
It is used to test if an element already exists in a set, or to access to a value through a key.

### Switch statement

switchcase statementCASE structure
It is used in switch statements to dispatch the control flow to the correct branch, and during the unification process in logic programming.

### Object-oriented programming

object-orientedobject orientedobject-oriented programming language

### Data type

typedatatypetypes
Comparison of programmer-defined data types (data types for which the programming language has no in-built understanding) may be carried out by custom-written or library functions (such as mentioned above), or, in some languages, by overloading a comparison operator – that is, assigning a programmer-defined meaning that depends on the data types being compared.