From Microduino Wiki
Jump to: navigation, search

%=(Compound modulo)

The arithmetic operator used among variables and constants. "%=" is a way of abbreviation.


x %= y;   //  It is equal to x = x % y;

x: Variable in non floating-point.
y: Variable or constant in non floating-point.

*For example

x = 9;
x %= 4;      // x = 1

The modulus operator cannot be used for floating-point data.

[Return to Arduino Syntax Manual]