Rexx-relational-operators

提供:Dev Guides
移動先:案内検索

Rexx-関係演算子

関係演算子を使用すると、オブジェクトを比較できます。 以下は、Rexxで使用可能な関係演算子です。 Rexxでは、真の値は1で示され、偽の値は0で示されます。

Operator Description Example
== Tests the equality between two objects 2 = 2 will give 1
< Checks to see if the left object is less than the right operand. 2 < 3 will give 1
=< Checks to see if the left object is less than or equal to the right operand. 2 =< 3 will give 1
> Checks to see if the left object is greater than the right operand. 3 > 2 will give 1
>= Checks to see if the left object is greater than or equal to the right operand. 3 > 2 will give 1

次のプログラムは、さまざまな演算子の使用方法を示しています。

/* Main program*/
X = 3
Y = 2

say X > Y
say X < Y
say X >= Y
say X <= Y
say X == Y

上記のプログラムの出力は次のようになります-

1
0
1
0
0