> ## Documentation Index
> Fetch the complete documentation index at: https://cofhe-docs.fhenix.zone/llms.txt
> Use this file to discover all available pages before exploring further.

# Arithmetic Operations

> add, sub, mul, div, rem, square — encrypted math operations

All arithmetic operations work on `euint8 | euint16 | euint32 | euint64 | euint128`. Both operands must be the same type.

### add

```solidity theme={null}
euint32 sum = FHE.add(a, b);
```

### sub

```solidity theme={null}
euint32 diff = FHE.sub(a, b);
```

### mul

```solidity theme={null}
euint32 product = FHE.mul(a, b);
```

### div

<Warning>
  Division by zero will cause the operation to revert.
</Warning>

```solidity theme={null}
euint32 quotient = FHE.div(a, b);
```

### rem

```solidity theme={null}
euint32 remainder = FHE.rem(a, b);
```

### square

```solidity theme={null}
euint32 squared = FHE.square(a);
```
