# LibUint256Array

### sum():

the `sum` function in the `LibUint256Array` library allows you to calculate the sum of all elements in a `uint256` array using efficient assembly operations.

**Input**:

<table><thead><tr><th>Field</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><p></p><pre class="language-solidity"><code class="lang-solidity">self
</code></pre></td><td><p></p><pre class="language-solidity"><code class="lang-solidity">uint256[]
</code></pre></td><td>An array of amounts whose sum needs to be found out.</td></tr></tbody></table>

**Output**:

<table><thead><tr><th>Field</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><p></p><pre class="language-solidity"><code class="lang-solidity">amountOut
</code></pre></td><td><p></p><pre class="language-solidity"><code class="lang-solidity">uint256
</code></pre></td><td>The final sum of all the amounts</td></tr></tbody></table>
