/=

名称

/=

説明

ある変数をある数値で割った結果を、元の変数に再度代入する際に利用できる便利な省略形である。

書式

x /= y; // equivalent to the expression x = x / y;

引数

x任意の変数。利用可能な型: int, float, double, byte, short。long。
y非ゼロの任意の変数もしくは定数。利用可能な型: int, float, double, byte, short, long。

使用例

1
2
x = 2;
x /= 2; // x now contains 1

参照

言語 /(除算)

オリジナルのページ

https://www.arduino.cc/reference/en/language/structure/compound-operators/compounddivision/

Last Revision: 2019/02/19

最終更新日

January 4, 2024

inserted by FC2 system