Rexx-logical-operators
提供:Dev Guides
Rexx-論理演算子
論理演算子は、ブール式を評価するために使用されます。 以下は、Rexxで使用可能な論理演算子です。
Operator | Description | Example |
---|---|---|
& | This is the logical “and” operator | 1 or 1 will give 1 |
This is the logical “or” operator | ||
1 or 0 will give 1 | \ | This is the logical “not” operator |
\0 will give 1 | && | This is the logical exclusive “or” operator |
例
次のプログラムは、さまざまな演算子の使用方法を示しています。
/* Main program*/
say 1 & 0
say 1 | 0
say 1 && 0
say \1
上記のプログラムの出力は次のようになります-
0
1
1
0