# Factorial

> Calculate the factorial of a number.

- ID: `factorial_basic`
- Type: Block
- Category: [Math](https://inventor.bot/docs/reference/blocks/math.md)

- Value block: it can be used directly inside expressions, e.g. `"Result: " + factorial_basic(Args{...})`.

**Inputs**

| Name | Required | Description | Value |
| --- | --- | --- | --- |
| `number` | yes | Must be a positive integer less than 20000. | e.g. `"5"` |

**Outputs**

| Name | Description | Value |
| --- | --- | --- |
| `factorial` | Computed factorial value. | e.g. `"120"` |

**Example**

```go
factorial := factorial_basic(Args{number: 5})
send_text_message(Args{channel_id: trigger.channel_id, message_content: "Factorial: " + factorial})
```