I want to find...

検索

Shares

Table of Content

-=

[Compound Operators]

説明

This is a convenient shorthand to perform subtraction of a constant or a variable from a variable.

構文

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

媒介変数

x: variable. Allowed data types: intfloatdoublebyteshortlong.
y: variable or constant. Allowed data types: intfloatdoublebyteshortlong.

x = 20;
x -= 2; // x now contains 18

See also

  • [Language] Normal Subtraction

Language Reference Home

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

上部へスクロール