Zum Hauptinhalt springen
CloudStudio

Relationale Operatoren

Relationale Operatoren

Relationale Operatoren werden in Vergleichsoperationen angewendet, und das Ergebnis ihrer Anwendung ist immer ein boolescher Wert (true / false). Sie können auf jeden Datentyp angewendet werden, aber in allen Fällen müssen beide Operanden vom gleichen Typ sein. Es ist wichtig, sich einige Vergleichsregeln zu merken:

  • Beim Vergleich von booleschen Werten wird der Wert true als größer als der Wert false betrachtet.
  • Bei Zeichenkettenwerten wird eine Zeichenkette als größer als eine andere betrachtet, wenn sie alphabetisch nach der anderen sortiert wird.
OperatorExplanationUnary / Binary
>Compares the operands on both sides of the operator and returns true when the left operand is greater than the right one.Binary
>=Compares the operands on both sides of the operator and returns true when the left operand is greater than or equal to the right one.Binary
<Compares the operands on both sides of the operator and returns true when the left operand is less than the right one.Binary
<=Compares the operands on both sides of the operator and returns true when the left operand is less than or equal to the right one.Binary
=Compares the operands on both sides of the operator and returns true when both are equal.Binary
<>Compares the operands on both sides of the operator and returns true when both are different.Binary

Zuletzt aktualisiert am

Auf dieser Seite