Home Developers Capabilities Ordinary factorial

CVP verified calculation capability

Ordinary factorial Calculation Capability

Exact n! for integers 0 ≤ n ≤ 5000 via BigInt arithmetic, with product expansion, digit count, and scientific notation for long integers.

Math Capability ID math.factorial version 1.0.2 CVP VERIFIED CURRENT Core

Model

Definition

Inputs / Outputs

Canonical symbols for this capability. Agent schemas remain the contract.

SymbolQuantityUnitRole
nNon-negative integer—input / output
nInputShare-URL alias for n—input
valueExact n! as a JSON number when it fits IEEE-754 safe integers; otherwise the exact decimal string—output
digits——output
expansion——output
scientific——output
max_n——output

Trusted Math contract

Inspectable numeric contract for this Capability@Version. Not a rewrite of the engine.

FieldDeclaration
numeric_domaininteger
exactnessexact
algorithmexact n! via successive integer product
valid_domaininteger n ≥ 0 in the published bound
singularity_policyINVALID_INPUT for n < 0 (Γ is math.special)
branch_policynot applicable — integer domain
tolerancenot applicable — exact integer identity
convergencenot applicable — non-iterative Euclidean / combinatorial
conditioningnot applicable — not a floating matrix
roundingnone — BigInt / exact integer
overflowcoded error or stringified BigInt when exceeding JSON number
reproducibilitydeterministic exact integer + Capability@Version
independent_oracleEvidence published cases (n! table)
golden_vectorsEvidence golden + boundary + property (and published_reference_case when listed)

Assumptions / Validity

Declared scope for this capability. Do not use it outside this domain.

Assumptions

Example

One numerical check. The calculator page holds worked steps and FAQ.

5! = 120; 10! = 3,628,800; 100! has 158 digits; 5000! has 16,326 digits

Open this example in the calculator

Trust

CVP VERIFIED · CVP protocol 1.0.0-proposed · Core assurance. Computational verification is defined by CVP. Supplemental domain review (internal) and named expert review are defined by the Review policy and do not by themselves determine CVP conformance.

CVP
CVP VERIFIED · CVP protocol 1.0.0-proposed · Core assurance· View Manifest · CVP overview · Specification
Assurance
Core
Declared partition coverage
PASS · 2/2 declared partitions (factorial, invalid-domain)
Calculation version
1.0.2
Verification
24/24 calculation tests · 8/8 legacy golden · 7/7 legacy boundary · 9/9 legacy property
Production surface contract
5/5
Versions
Calculation 1.0.2 · CVP protocol 1.0.0-proposed · Evidence 2026-09-08.exact-integer-profile
Verification revision
2026-09-08.exact-integer-profile · 19/19 property · digest b7065c58307c
Reference
O1 model · O3 expected_values · O3 numerical_behavior · O2 expected_values · O2 numerical_behavior
Numerical scope
Exact decimal-string identity vs Python math.factorial on the 23 published tabulated vectors (named 0,1,5,10,20,100,5000 plus 16 seeded n in 0–4999). 5000! is verified as the full 16,326-digit value and as SHA-256 of those ASCII digits. This is not a whole-domain proof beyond the published table.
Interfaces
PASS · UI (SSR) / REST / MCP
ui-ssr is query-result HTML, not a live browser session.
CVP suite
6/6 golden · 7/7 CVP boundary · 6/6 invalid · 19/19 property · 5/5 metamorphic · 23/23 O3 · 1/1 cross-interface · 1/1 CVP contract
Supplemental domain review
Not performed
Named expert review
Not performed
Version lock
Supported (409 VERSION_MISMATCH)
Artifact consistency
Build verified · 1.0.2 (workspace artifacts agree)
Review-policy tier
Engine tested — catalog token engine_tested; supplemental; not CVP status
This calculator CURRENT · Public schema 1.0.2 matches · Semantic contract ✓ · Production attested · Public/cache ✓ · Origin ✓

Call this capability

Human page, REST, and MCP share the same engine and calculation_version. Build verified hashes workspace artifacts only. After deploy, attest:production GETs canonical URLs twice — the public/cached view an Agent actually hits, and origin — including every /capabilities/{id} HTML page. Public Capability HTML version must match catalog before production attestation passes. Live Trust rows above fetch /.well-known/calculatorx-production-attestation.json and the output schema const. Build hashes: release integrity. That proves currently published page / engine / schema / evidence / MCP agree — not that a historical version is independently immutable. Reference Calculation Standard — Production surface contract 5/5.

curl -sS -X POST 'https://www.calculatorx.com/api/v1/calc/factorial' \
  -H 'Content-Type: application/json' \
  -d '{"inputs":{"n":0},"calculation_version":"1.0.2"}'

POST /api/v1/calc/factorial. This is a POST calculate endpoint — do not GET it.

Full REST contract: REST API docs.

Tool id
factorial
Engine
factorial
REST
POST /api/v1/calc/factorial
MCP
execute_calculation with capability_id: "math.factorial"
Agent input schema
Canonical (MCP / Agent)
Output schema
JSON Schema (latest)
Versioned input schema
Immutable pin (1.0.2)
Versioned output schema
Immutable pin (1.0.2)

References

Human-readable sources plus CVP reference evidence classes.

Sources

Derived identities

Reference evidence classes: O1 model · O3 expected_values · O3 numerical_behavior · O2 expected_values · O2 numerical_behavior

Try with an agent

Inspect, then execute. Same engine as REST and the human calculator.

curl -sS -X POST 'https://www.calculatorx.com/mcp' \
  -H 'Content-Type: application/json' \
  -H 'MCP-Protocol-Version: 2026-07-28' \
  -H 'Mcp-Method: tools/call' \
  -H 'Mcp-Name: inspect_capability' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"inspect_capability","arguments":{"capability_id":"math.factorial"},"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientInfo":{"name":"calculatorx-docs-example","version":"1.0.0"},"io.modelcontextprotocol/clientCapabilities":{}}}}'

Pin calculation_version (1.0.2) when the result must stay reproducible.

Inspect the trust tier and required assurance level before execution. Full protocol notes: MCP docs.