> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/NormandoRamirezDelgado/6C-Febrero-2026/llms.txt
> Use this file to discover all available pages before exploring further.

# Arithmetic Operators

> Learn how to perform mathematical operations in Dart using arithmetic operators

## Overview

Arithmetic operators allow you to perform mathematical calculations in Dart. These operators work with numeric types like `int` and `double`.

## Arithmetic Operators Table

| Operator | Description               | Example   | Result     |
| -------- | ------------------------- | --------- | ---------- |
| `+`      | Addition                  | `10 + 3`  | `13`       |
| `-`      | Subtraction               | `10 - 3`  | `7`        |
| `*`      | Multiplication            | `10 * 3`  | `30`       |
| `/`      | Division (returns double) | `10 / 3`  | `3.333...` |
| `~/`     | Integer Division          | `10 ~/ 3` | `3`        |
| `%`      | Modulo (remainder)        | `10 % 3`  | `1`        |

<Note>
  The `~/` operator performs integer division and returns only the whole number part, discarding any remainder.
</Note>

## Basic Example

Here's a complete example demonstrating all arithmetic operators:

```dart theme={null}
void main() {
  //Operadores Aritméticos
  int numeroUno = 10;
  int numeroDos = 3;

  print(numeroUno + numeroDos);    // Suma: 13
  print(numeroUno - numeroDos);    // Resta: 7
  print(numeroUno * numeroDos);    // Multiplicación: 30
  print(numeroUno / numeroDos);    // División: 3.333...
  print(numeroUno ~/ numeroDos);   // División entera: 3
  print(numeroUno % numeroDos);    // Módulo: 1
}
```

## Key Differences

### Division (`/`) vs Integer Division (`~/`)

The key difference between these two operators:

* **Division (`/`)**: Returns a `double` with the exact result including decimals
* **Integer Division (`~/`)**: Returns an `int` with only the whole number part

```dart theme={null}
int a = 10;
int b = 3;

print(a / b);   // Output: 3.3333333333333335 (double)
print(a ~/ b);  // Output: 3 (int)
```

<Tip>
  Use the modulo operator `%` to get the remainder of a division. This is particularly useful for checking if a number is even or odd: `number % 2 == 0` means the number is even.
</Tip>

## Practical Uses

### Calculating Remainder

```dart theme={null}
int total = 10;
int divisor = 3;
int remainder = total % divisor;  // remainder = 1
```

### Integer Division for Grouping

```dart theme={null}
int students = 25;
int groupSize = 4;
int numberOfGroups = students ~/ groupSize;  // 6 complete groups
int studentsLeft = students % groupSize;     // 1 student left over
```
