/=

[Compound Operators]

説明

This is a convenient shorthand to perform division of a variable with another constant or variable.

Syntax

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

Parameters

x: variable. Allowed data types: intfloatdoublebyteshortlong.
ynon zero variable or constant. Allowed data types: intfloatdoublebyteshortlong.

Example Code

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

See also

  • [Language] Normal Division

Language Reference Home

86Duino のリファレンスのテキストは Arduino レファレンス を編集したもので、 Creative Commons Attribution-ShareAlike 3.0 License下でライセンスされています。リファレンス内のコードサンプルはパブリックドメインとして公開されています。

コメントする

上部へスクロール