メインコンテンツまでスキップ

# 比較演算子

これらの演算子は値を比較するために使用されます。比較のオプションには等価性、大なりと小なり、そして値が他の値のペアの間に落ちるかどうかが含まれます。

### `Is`, `Are`, `=`, `Equals`, `Equal To`, `Is Equal To`, `Does Equal`, `Are Equal`, `The Same` 演算子​

operand1 is operand2 {considering case | ignoring case} val1 and val2 are equal

``if answer = 7 then ...``

``if name is "sarah" then ...``

``if prefix is "Mac" considering case then ...``

``put 5 * 3 and 15 are equal --> True``

``put 5 * 3 is the same as 15 --> True``

### `Is Not`, `Are Not`, `<>`, `Does Not Equal`, `Is Not Equal To`, `Isn't`, `Aren't`, `Aren't Equal`, `Doesn't Equal`, `Isn't Equal To`, `Isn't the Same`, `Are Not the Same` 演算子​

operand1 is not operand2 {considering case | ignoring case}

``if answer is not 7 then ...``

``if name isn't "sarah" then ...``

``if prefix is not "Mac" considering case then ...``

``put "CAT" and "cat" aren't equal considering case --> True``

``put "cat" and "dog" are not the same --> True``

``put 4 + 6 isn't the same as 2 * 12``

### `Is Less Than` , `<` , `Comes Before` , `Is Not Greater Than or Equal To` , `Is Earlier Than` 演算子​

md 構文：
operand1 {is} less than operand2 {considering case | ignoring case}

``if answer < 7 then ...``

``if name comes before "Beetle" then ...``

``if prefix is less than "Mac" ignoring case then ...``

### `Is Greater Than`, `>` , `Is More Than`, `Comes After`, `Is Not Less Than or Equal To`, `Is Later Than`, `Is Past` 演算子​

operand1 {is} greater than operand2 {considering case | ignoring case}

``if answer > 7 then ...``

``if name comes after "Hannibal" then ...``

``if prefix is greater than "Mac" ignoring case then ...``

### `Is Less Than or Equal To` , `<=` , `Does Not Come After` , `Is Not Greater Than` , `Is Not Later Than`, `Is At Most`, `Is No More Than`, `Is Not Past` 演算子​

``if answer <= 8 then ...``

``if name does not come after "Frank" then ...``

``if the number of items in guestList is no more than 12 then ...``

``if prefix is not greater than "Mac" considering case then ...``

### `Is Greater Than or Equal To` , `>=` , `Does Not Come Before` , `Is Not Less Than` , `Is Not Earlier Than`, `Is At Least`, `Is No Less Than` 演算子​

``if answer >= 7 then ...``

``if name does not come before "Zoo" then ...``

``if customer's age is at least 17 then admitToRMovie``

``if prefix is not less than "Mac" considering case then ...``

### `Between` , `Is Between` , `Is Not Between` , `Comes Between` , `Does Not Come Between` 演算子​

**動作：**指定した値が他の2つの値の範囲内にあるかどうか、またはその範囲外にあるかどうかをテストし、真または偽を返します。 `between`演算子は `value >= lowEndValue and value <= highEndValue`と等価です。テストされる値は両方のエンド値と比較されます。それが間に落ちる、またはいずれかのエンド値と等しい場合、結果は真です。範囲のエンド値は昇順または降順で指定できます。

テストされる値は「エンド値」の両方と比較されます。それがいずれかのエンド値と等しい、または一方より大きく、他方より小さい場合、`between`式は真に評価されます。それ以外の場合は偽に評価されます。EndValue1はEndValue2より大きいかもしれないし、小さいかもしれません。内部的には、テストされる値はそれぞれのエンド値と独立して比較されるため、各エンド値に対して異なるタイプの比較が使用される可能性があります（例えば、一方が数値で他方がテキストなど）。

``if answer is between 7 and 11 then ...``

``if wd does not come between "Zoo" and "Zygote" ignoring case then ...``

``if height is between minAllowedHeight and maxAllowedHeight then ...``