*=

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


*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 types
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]