# Integer factorial

`integer-factorial` · version 1.0.0 · Numbers & math · free, no key needed

Compute n! (n factorial) exactly for a bounded non-negative integer n.

**Use when you need to: integer factorial · n factorial · compute n!.**

## Supported

- integer factorial
- n factorial
- compute n!

## Not supported

- negative factorial
- gamma function
- double factorial

## Behavior

- n is a JSON integer from 0 to 100000.
- 0! is 1 by convention.
- The result is computed exactly with BigInt multiplication, never floating point.
- Requests whose exact result would exceed 1000 digits are rejected rather than truncated; in practice this rejects n much smaller than the nominal input ceiling.

## Input

- `n` (integer, required): min 0; max 100000

## Output

- `value` (string, required)

## Limits

- max n: 100000
- max digits: 1000

## Example

Request input:

```json
{
  "n": 10
}
```

Response:

```json
{
  "result": {
    "value": "3628800"
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "integer-factorial",
  "version": "1.0.0",
  "input": {
    "n": 10
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/integer-factorial/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"n":10}'
```

The machine-readable contract is at [/v1/tools/integer-factorial/versions/1.0.0](/v1/tools/integer-factorial/versions/1.0.0).

### CLI

```sh
node cli.mjs run integer-factorial 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Array integer GCD](/tools/array-integer-gcd): Compute the non-negative greatest common divisor of an array of canonical integer strings.
- [Array integer LCM](/tools/array-integer-lcm): Compute the non-negative least common multiple of an array of canonical integer strings.
- [Integer binomial coefficient](/tools/integer-binomial-coefficient): Compute the exact binomial coefficient C(n, k), the number of ways to choose k items from n.
- [Integer permutations count](/tools/integer-permutations-count): Compute the exact number of k-permutations of n distinct items, P(n, k) = n! / (n-k)!.
- [Array integer adjacent diff](/tools/array-integer-adjacent-diff): Replace an array of canonical integer strings with consecutive first differences.
- [Array integer clamp](/tools/array-integer-clamp): Clamp an array of canonical integer strings to optional inclusive min and max bounds.
