> For the complete documentation index, see [llms.txt](https://math-5.gitbook.io/math/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://math-5.gitbook.io/math/reference/mathematical-operations/divide.md).

# divide

## Divide any two numbers

```cpp
divide<return_type>(a, b);
```

will return the quotient of the two given numbers. The return\_type specifies in which data type the result will be returned in, like shown in below example:&#x20;

```cpp
divide<int>(12, 3.53); //4
divide<float>(3.002, 3.522); //0.852357
divide<bool>(0, 2); //0
------------------------
divide<char>('z', 2); //'='
```

{% hint style="warning" %}
Typically division works only for numeric data types, but in this case, you have an additional option for characters. Before using it in that way, please test it before actually implementing something.&#x20;

Also be careful of the denominator being zero, because the compiler won't tell you that it is! It's not a bug, it's a feature.  :wink:
{% endhint %}
