Arithmetic Operations (Dart)

  • + addition, - subtraction, * multiplication, / division (returns double), ~/ integer division (drops remainder), % modulo (remainder).
  • Example: var x = 5 + 3; // 8, var y = 10 ~/ 4; // 2, var z = 10 % 4; // 2.
  • Use parentheses to control order: (a + b) * c.
  • Convert between int/double with toDouble()/toInt() when mixing types.