/= (division composée)

Description

Réalise une opération mathématique entre une variable et une autre variable ou une constante. Les opérateurs /= sont juste utiles pour raccourcir la forme complète de l'opération mathématique, comme listé ci-dessous.

Syntaxe

x /= y; // équivaut à l'expression x = x / y

Paramètres

  • x: tout type de variable
  • y: tout type de variable ou constante

Exemple

void setup() { Serial.begin(9600); int x = 6; x /= 2; // x contient 3 Serial.print("x = "); Serial.println(x); } void loop() { }

The result on Serial Monitor:

COM6
Send
x = 3;
Autoscroll Show timestamp
Clear output
9600 baud  
Newline  

ARDUINO BUY RECOMMENDATION

Arduino UNO R3
Arduino Starter Kit
Please note: These are Amazon affiliate links. If you buy the components through these links, We will get a commission at no extra cost to you. We appreciate it.

※ OUR MESSAGES