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

# Camel.toolkits.math toolkit

<a id="camel.toolkits.math_toolkit" />

<a id="camel.toolkits.math_toolkit.MathToolkit" />

## MathToolkit

```python theme={"system"}
class MathToolkit(BaseToolkit):
```

A class representing a toolkit for mathematical operations.

This class provides methods for basic mathematical operations such as
addition, subtraction, multiplication, division, and rounding.

<a id="camel.toolkits.math_toolkit.MathToolkit.math_add" />

### math\_add

```python theme={"system"}
def math_add(self, a: float, b: float):
```

Adds two numbers.

**Parameters:**

* **a** (float): The first number to be added.
* **b** (float): The second number to be added.

**Returns:**

float: The sum of the two numbers.

<a id="camel.toolkits.math_toolkit.MathToolkit.math_subtract" />

### math\_subtract

```python theme={"system"}
def math_subtract(self, a: float, b: float):
```

Do subtraction between two numbers.

**Parameters:**

* **a** (float): The minuend in subtraction.
* **b** (float): The subtrahend in subtraction.

**Returns:**

float: The result of subtracting :obj:`b` from :obj:`a`.

<a id="camel.toolkits.math_toolkit.MathToolkit.math_multiply" />

### math\_multiply

```python theme={"system"}
def math_multiply(
    self,
    a: float,
    b: float,
    decimal_places: int = 2
):
```

Multiplies two numbers.

**Parameters:**

* **a** (float): The multiplier in the multiplication.
* **b** (float): The multiplicand in the multiplication.
* **decimal\_places** (int, optional): The number of decimal places to round to. Defaults to 2.

**Returns:**

float: The product of the two numbers.

<a id="camel.toolkits.math_toolkit.MathToolkit.math_divide" />

### math\_divide

```python theme={"system"}
def math_divide(
    self,
    a: float,
    b: float,
    decimal_places: int = 2
):
```

Divides two numbers.

**Parameters:**

* **a** (float): The dividend in the division.
* **b** (float): The divisor in the division.
* **decimal\_places** (int, optional): The number of decimal places to round to. Defaults to 2.

**Returns:**

float: The result of dividing :obj:`a` by :obj:`b`.

<a id="camel.toolkits.math_toolkit.MathToolkit.math_round" />

### math\_round

```python theme={"system"}
def math_round(self, a: float, decimal_places: int = 0):
```

Rounds a number to a specified number of decimal places.

**Parameters:**

* **a** (float): The number to be rounded.
* **decimal\_places** (int, optional): The number of decimal places to round to. Defaults to 0.

**Returns:**

float: The rounded number.

<a id="camel.toolkits.math_toolkit.MathToolkit.get_tools" />

### get\_tools

```python theme={"system"}
def get_tools(self):
```

**Returns:**

List\[FunctionTool]: A list of FunctionTool objects
representing the functions in the toolkit.

<a id="camel.toolkits.math_toolkit.MathToolkit.add" />

### add

```python theme={"system"}
def add(self, *args, **kwargs):
```

Deprecated: Use math\_add instead.

<a id="camel.toolkits.math_toolkit.MathToolkit.sub" />

### sub

```python theme={"system"}
def sub(self, *args, **kwargs):
```

Deprecated: Use math\_subtract instead.

<a id="camel.toolkits.math_toolkit.MathToolkit.multiply" />

### multiply

```python theme={"system"}
def multiply(self, *args, **kwargs):
```

Deprecated: Use math\_multiply instead.

<a id="camel.toolkits.math_toolkit.MathToolkit.divide" />

### divide

```python theme={"system"}
def divide(self, *args, **kwargs):
```

Deprecated: Use math\_divide instead.

<a id="camel.toolkits.math_toolkit.MathToolkit.round" />

### round

```python theme={"system"}
def round(self, *args, **kwargs):
```

Deprecated: Use math\_round instead. Note: This was shadowing
Python's built-in round().
