Arithmetic Operators
Explore how to use arithmetic operators in Dart including addition, subtraction, multiplication, division, modulo, and integer division. Understand the difference between prefix and postfix increment and decrement operators through clear examples. This lesson helps you master fundamental Dart operators essential for programming and preparing for Flutter development.
A list of operators
Arithmetic operators are operators that perform arithmetic operations such as addition and subtraction. Below is a list of the arithmetic operators supported by Dart.
| Operator | Use |
|---|---|
+ |
Adds two operands |
- |
Subtracts the second operand from the first |
-expr |
Reverses the sign of the expression (unary minus) |
* |
Multiplies both operands |
/ |
Divides the first operand by the second operand |
~/ |
Divides the first operand by the second operand and returns an integer value |