> 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.md).

# Mathematical operations

maTH library  started as a library of mathematical operations made from scratch. Here's a list of all operations the library supports:

<table data-full-width="true"><thead><tr><th>Function</th><th>Description</th><th data-type="content-ref">Source</th></tr></thead><tbody><tr><td><code>int factorial(int n)</code></td><td>Find the factorial of n</td><td><a href="/math/reference/mathematical-operations/factorial.md">factorial</a></td></tr><tr><td><code>long long factorialL(int n)</code></td><td>Find the factorial of n</td><td><a href="/math/reference/mathematical-operations/factoriall.md">factorialL</a></td></tr><tr><td><code>std::vector&#x3C;int> pascal(int n)</code></td><td>Return the nth row of pascal triangle</td><td><a href="/math/reference/mathematical-operations/pascal.md">pascal</a></td></tr><tr><td><code>int combinations(int n, int k)</code></td><td>How many unique combinations are there with a population of n, whilst selecting k items. </td><td><a href="/math/reference/mathematical-operations/combinations.md">combinations</a></td></tr><tr><td><code>int combinationsWithRep(int n, int k)</code></td><td>How many combinations are there with a population of n, whilst selecting k items (items have repetition). </td><td><a href="/math/reference/mathematical-operations/combinationswithrep.md">combinationsWithRep</a></td></tr><tr><td><code>int permutations(int n, int k)</code></td><td>Permutate k items in population size n. </td><td><a href="/math/reference/mathematical-operations/permutations.md">permutations</a></td></tr><tr><td><code>int pow(int a, int n)</code></td><td>Raise a to the power of n</td><td><a href="/math/reference/mathematical-operations/pow.md">pow</a></td></tr><tr><td><code>double pow(double a, int n)</code></td><td>Raise a to the power of n</td><td><a href="/math/reference/mathematical-operations/pow.md">pow</a></td></tr><tr><td><code>double pow(int a, double n)</code></td><td>Raise a to the power of n</td><td><a href="/math/reference/mathematical-operations/pow.md">pow</a></td></tr><tr><td><code>double pow(double a, double n)</code></td><td>Raise a to the power of n</td><td><a href="/math/reference/mathematical-operations/pow.md">pow</a></td></tr><tr><td><code>int GCD(int a, int b)</code></td><td>Find GCD of two numbers</td><td><a href="/math/reference/mathematical-operations/gcd.md">GCD</a></td></tr><tr><td><code>int LCM(int a, int b)</code></td><td>Find LCM of two numbers</td><td><a href="/math/reference/mathematical-operations/lcm.md">LCM</a></td></tr><tr><td><code>add&#x3C;return_type>(a, b)</code></td><td>Add two numbers</td><td><a href="/math/reference/mathematical-operations/add.md">add</a></td></tr><tr><td><code>subtract&#x3C;return_type>(a, b)</code></td><td>Subtract two numbers</td><td><a href="/math/reference/mathematical-operations/subtract.md">subtract</a></td></tr><tr><td><code>multiply&#x3C;return_type>(a, b)</code></td><td>Multiply two numbers</td><td><a href="/math/reference/mathematical-operations/multiply.md">multiply</a></td></tr><tr><td><code>divide&#x3C;return_type>(a, b)</code></td><td>Divide two numbers</td><td><a href="/math/reference/mathematical-operations/divide.md">divide</a></td></tr><tr><td><code>sin(x)</code></td><td>Compute sine</td><td><a href="/math/reference/mathematical-operations/sin.md">sin</a></td></tr><tr><td><code>cos(x)</code></td><td>Compute cosine</td><td><a href="/math/reference/mathematical-operations/cos.md">cos</a></td></tr><tr><td><code>ln&#x3C;return_type>(x)</code></td><td>Find the natural logarithm of a number</td><td><a href="/math/reference/mathematical-operations/ln.md">ln</a></td></tr><tr><td><code>log&#x3C;return_type>(base, argument)</code></td><td>Find the logarithm of argument with a given base</td><td><a href="/math/reference/mathematical-operations/log.md">log</a></td></tr><tr><td><code>radToDeg&#x3C;return_type>(rad)</code></td><td>Convert radians to degrees</td><td><a href="/math/reference/mathematical-operations/radtodeg.md">radToDeg</a></td></tr><tr><td><code>degToRad&#x3C;return_type>(deg)</code></td><td>Convert degrees to radians</td><td><a href="/math/reference/mathematical-operations/degtorad.md">degToRad</a></td></tr><tr><td><code>mod&#x3C;return_type>(dividend, divisor)</code></td><td>Remainder of a quotient</td><td><a href="/math/reference/mathematical-operations/mod.md">mod</a></td></tr><tr><td><code>abs&#x3C;return_type>(val)</code></td><td>Absolute value of number</td><td><a href="/math/reference/mathematical-operations/abs.md">abs</a></td></tr><tr><td><code>int floor(x)</code></td><td>Round value down</td><td><a href="/math/reference/mathematical-operations/floor.md">floor</a></td></tr><tr><td><code>int ceil(x)</code></td><td>Round value up</td><td><a href="/math/reference/mathematical-operations/ceil.md">ceil</a></td></tr><tr><td><code>root&#x3C;return_type>(n, a)</code></td><td>Find the nth root of a number</td><td><a href="/math/reference/mathematical-operations/root.md">root</a></td></tr><tr><td><code>exp&#x3C;return_type>(x)</code></td><td>Exponential function</td><td><a href="/math/reference/mathematical-operations/exp.md">exp</a></td></tr><tr><td><code>tan(x)</code></td><td>Compute tangent</td><td><a href="/math/reference/mathematical-operations/tan.md">tan</a></td></tr><tr><td><code>arcsin(x)</code></td><td>Compute arcsine</td><td><a href="/math/reference/mathematical-operations/arcsin.md">arcsin</a></td></tr><tr><td><code>arccos(x)</code></td><td>Compute arccosine</td><td><a href="/math/reference/mathematical-operations/arccos.md">arccos</a></td></tr><tr><td><code>arctan(x)</code></td><td>Compute arctangent</td><td><a href="/math/reference/mathematical-operations/arctan.md">arctan</a></td></tr><tr><td><code>sinh(x)</code></td><td>Compute hyberbolic sine</td><td><a href="/math/reference/mathematical-operations/sinh.md">sinh</a></td></tr><tr><td><code>cosh(x)</code></td><td>Compute hyperbolic cosine</td><td><a href="/math/reference/mathematical-operations/cosh.md">cosh</a></td></tr><tr><td><code>int round(x)</code></td><td>Rounds a number up/down</td><td><a href="/math/reference/mathematical-operations/round.md">round</a></td></tr></tbody></table>

{% hint style="info" %}
If the argument data type is defined, eg. `int round(x)`, it means x can be whatever data type. func\_name\<return\_type> specifies, that you can specifically say, in which data type you want your result to be in.&#x20;
{% endhint %}
