-=

From Microduino Wiki
Revision as of 05:23, 17 August 2016 by Fengfeng (talk) (Created page with "-=(Compound subtraction) '''*Description'''<br> Arithmetic operator used between variables or constants. "-=" is an abbreviation. '''*Syntax'''<br> <pre style="color:...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

-=(Compound subtraction)


*Description
Arithmetic operator used between variables or constants. "-=" is an abbreviation.


*Syntax

x += y;   // It is equal to x = x + y;
x -= y;   // It is equal to x = x - y; 
x *= y;   //It is equal to x = x * y; 
x /= y;   // It is equal to x = x / y; 


*Parameters
x: variable in any data type
y: variable or constant in any data type


*Example

x = 2;
x += 4;      // x = 6
x -= 3;      // x = 3
x *= 10;     // x = 30
x /= 2;      // x = 15

[Return to Arduino Syntax Manual]