>

名称

>

説明

左辺の変数と右辺の値もしくは変数の比較を行う。左辺の値が右辺の値より大きいとtrueを返す。異なるデータ型の変数を比較することができるが、予期しない結果を引き起こすこともある。このため、signed/unsignedを含め同じデータ型で比較することを推奨する。

書式

x > y; // is true if x is bigger than y and it is false if x is equal or smaller than y

引数

x変数。利用できるデータ型: int, float, double, byte, short, long。
y変数もしくは定数。利用できるデータ型: int, float, double, byte, short, long。

使用例

1
2
3
if (x > y) {  // tests if x is greater (bigger) than y
  // do something only if the comparison result is true
}

注意

正数は負数より大きい。

参照

オリジナルのページ

https://www.arduino.cc/reference/en/language/structure/comparison-operators/greaterthan/

Last Revision: 2019/02/21

最終更新日

January 4, 2024

inserted by FC2 system