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:
{
"n": 10
}
Response:
{
"result": {
"value": "3628800"
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "integer-factorial",
"version": "1.0.0",
"input": {
"n": 10
}
}
HTTP (no key)
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.
CLI
node cli.mjs run integer-factorial 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Array integer GCD: Compute the non-negative greatest common divisor of an array of canonical integer strings.
- Array integer LCM: Compute the non-negative least common multiple of an array of canonical integer strings.
- Integer binomial coefficient: Compute the exact binomial coefficient C(n, k), the number of ways to choose k items from n.
- Integer permutations count: Compute the exact number of k-permutations of n distinct items, P(n, k) = n! / (n-k)!.
- Array integer adjacent diff: Replace an array of canonical integer strings with consecutive first differences.
- Array integer clamp: Clamp an array of canonical integer strings to optional inclusive min and max bounds.