# Math Operations

This function block provides basic mathematical operations that can be performed on a set of numerical inputs. Users can select the operation they wish to perform, such as addition, subtraction, multiplication, or division.

## 📥 Inputs <a href="#inputs" id="inputs"></a>

`Number` Users can provide one or more numerical inputs to be processed by the selected mathematical operation.

## 📤 Outputs <a href="#outputs" id="outputs"></a>

`Number` The result of the applied mathematical operation on the provided inputs.

## 🕹️ Controls <a href="#controls" id="controls"></a>

`Input size` A dropdown menu that allows users to specify how many input numbers they want to use for the operation, from 2 up to 20.

`Select a method` A dropdown menu to choose the mathematical operation to apply among the following options:

* **ADD**
* **SUBTRACT**
* **MULTIPLY**
* **DIVIDE**

## 🎨 Features <a href="#features" id="features"></a>

`Dynamic Input Sockets` The number of input sockets adjusts dynamically based on the user's selection in the `Input size` dropdown.

`Versatile Operations` Users have the flexibility to perform various mathematical operations by simply selecting the desired method.

## 📝 Usage Instructions <a href="#usage" id="usage"></a>

1. **Set Input Size**: Use the `Input size` dropdown to select how many numerical inputs you want to provide.
2. **Input Numbers**: Connect numerical inputs to the available input sockets.
3. **Select Operation**: Choose the desired mathematical operation from the `Select a method` dropdown.
4. **Evaluate**: Run the block to compute the result based on the provided inputs and selected operation.

## 📊 Evaluation <a href="#evaluation" id="evaluation"></a>

Upon running this function block, users will receive the result of their selected mathematical operation applied to the provided numbers.

## 💡 Tips and Tricks <a href="#tips-and-tricks" id="tips-and-tricks"></a>

<details>

<summary>Using DIVIDE Operation</summary>

Ensure that the input numbers provided in the divide operation are non-zero to avoid division errors. Double-check inputs before executing.

</details>

<details>

<summary>Handling Negative Numbers</summary>

For subtraction and division, be cautious when using negative numbers as this may yield unexpected outcomes depending on the order of operations.

</details>

<details>

<summary>Combining with Other Blocks</summary>

Consider using this block in conjunction with the `Data Type Converter` or `Batch Processing` to preprocess numbers before performing operations. This can help avoid errors and streamline operations.

</details>

## 🛠️ Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

<details>

<summary>Error on Input Connections</summary>

If you experience issues while connecting inputs, verify that you have selected the appropriate input size. Adjust the size in the dropdown to ensure a matching number of inputs.

</details>

<details>

<summary>Invalid Results</summary>

If the output seems incorrect, check each input number for accuracy and ensure the correct mathematical operation is selected.

</details>
