{
  "capability_id": "math.gcf",
  "tool_id": "gcf",
  "engine": "gcf",
  "calculation_version": "1.0.2",
  "generated_at": "2026-09-16T22:03:43.771Z",
  "engine_build": "2026-09-16",
  "test_count": 20,
  "passed": 20,
  "failed": 0,
  "tests_summary": {
    "golden": {
      "total": 6,
      "passed": 6
    },
    "boundary": {
      "total": 7,
      "passed": 7
    },
    "property": {
      "total": 7,
      "passed": 7
    }
  },
  "engine_tested": true,
  "expert_reviewed": false,
  "internally_reviewed": false,
  "review_kind": null,
  "source_checked": true,
  "reviewed_by": null,
  "reviewer_role": null,
  "last_reviewed": null,
  "expert_review": {
    "status": "optional_not_performed",
    "reviewer": null,
    "scope": [
      "formula",
      "input semantics",
      "assumptions",
      "limitations",
      "sources",
      "tests"
    ],
    "note": "Domain expert review is optional under CVP (CVP-EXP-01). Absence does not block CVP Verified. See Review policy for supplemental domain assurance."
  },
  "internal_review": {
    "status": "not_applicable",
    "reviewer": null
  },
  "page": "https://www.calculatorx.com/calc/math/gcf",
  "api": "https://www.calculatorx.com/api/v1/calc/gcf",
  "schema_input": "https://www.calculatorx.com/schemas/math.gcf.input.json",
  "schema_output": "https://www.calculatorx.com/schemas/math.gcf.output.json",
  "assumptions": [
    "Integer inputs; negatives treated by absolute value.",
    "Zeros are ignored unless every input is 0.",
    "GCF of a set of all zeros is undefined."
  ],
  "limitations": [
    "Integers only; negatives treated by absolute value",
    "Each integer ≤ 48 decimal digits (product bound, not a mathematical bound)",
    "Zeros are ignored unless every input is 0 (then UNDEFINED)",
    "Need at least two numbers → NEED_TWO_NUMBERS",
    "Non-integers → INVALID_NUMBER",
    "Integers beyond MAX_SAFE_INTEGER must be decimal strings in JSON"
  ],
  "boundary_conditions": [
    "Need at least two numbers → NEED_TWO_NUMBERS",
    "Missing list → MISSING_REQUIRED_INPUT",
    "Non-integers rejected → INVALID_NUMBER",
    "More than 48 digits → VALUE_ABOVE_MAX",
    "All zeros → UNDEFINED"
  ],
  "sources": [
    {
      "title": "Encyclopedia of Mathematics — Greatest common divisor",
      "section": "Definition; pairwise fold; prime-factor form",
      "url": "https://encyclopediaofmath.org/wiki/Greatest_common_divisor",
      "supports": "GCF of n integers exists when not all are zero; (a₁,…,aₙ,aₙ₊₁)=((a₁,…,aₙ),aₙ₊₁); shared-prime min exponents",
      "kind": "reference"
    },
    {
      "title": "Encyclopedia of Mathematics — Euclidean algorithm",
      "section": "Remainder recurrence GCF(a,b)=GCF(b, a mod b)",
      "url": "https://encyclopediaofmath.org/wiki/Euclidean_algorithm",
      "supports": "Binary Euclidean primitive used inside the pairwise fold",
      "kind": "reference"
    },
    {
      "title": "CalculatorX integer convention",
      "section": "Absolute value; zero-set; 48-digit BigInt domain",
      "supports": "Negatives by |n|; ignore zeros unless the whole set is 0; exact BigInt with a product digit cap",
      "kind": "definition"
    }
  ],
  "methods": [
    "Pairwise Euclidean fold (canonical engine)",
    "Prime-factor GCF (cross-check when every |n| ≤ 1,000,000)",
    "Factor-list GCF (cross-check when every |n| ≤ 10,000)"
  ],
  "fingerprint": "sha256:ce4c8fd3816846a3947cf60cc5a029f9ac4466c2dbe18ebc7381d0b2803029fc",
  "tests": [
    {
      "id": "triple",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "values": [
          8,
          12,
          20
        ]
      },
      "expect": {
        "value": 4,
        "exact": "4"
      },
      "expectWarning": null,
      "actual": {
        "values": [
          8,
          12,
          20
        ],
        "value": 4,
        "exact": "4",
        "count": 3,
        "formula": "GCF(a,b,c,…) = GCF(GCF(a,b),c,…)",
        "binary_formula": "GCF(a,b)=GCF(b, a mod b)",
        "methods": {
          "factor": {
            "available": true,
            "result": 4,
            "matches": true
          },
          "prime": {
            "available": true,
            "result": 4,
            "matches": true
          },
          "euclidean": {
            "available": true,
            "result": 4,
            "matches": true
          },
          "agree": true,
          "independent_count": 3
        },
        "work": {
          "factors": [
            "--- Factors ---",
            "8: 1, 2, [4], 8",
            "12: 1, 2, 3, [4], 6, 12",
            "20: 1, 2, [4], 5, 10, 20",
            "Largest common factor: 4"
          ],
          "primes": [
            "--- Prime factorization ---",
            "8 = 2 × 2 × 2",
            "12 = 2 × 2 × 3",
            "20 = 2 × 2 × 5",
            "Shared primes: 2^2 = 4"
          ],
          "euclidean": [
            "--- Euclidean algorithm ---",
            "GCF of many = fold pairwise: GCF(GCF(…), next)",
            "GCF(8, 12):",
            "  12 = 1 × 8 + 4",
            "  8 = 2 × 4 + 0",
            "  Last nonzero remainder → GCF = 4",
            "  → 4",
            "GCF(4, 20):",
            "  20 = 5 × 4 + 0",
            "  Last nonzero remainder → GCF = 4",
            "  → 4"
          ]
        },
        "max_digits": 48
      },
      "tol": 0
    },
    {
      "id": "pair",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "values": [
          18,
          27
        ]
      },
      "expect": {
        "value": 9
      },
      "expectWarning": null,
      "actual": {
        "values": [
          18,
          27
        ],
        "value": 9,
        "exact": "9",
        "count": 2,
        "formula": "GCF(a,b,c,…) = GCF(GCF(a,b),c,…)",
        "binary_formula": "GCF(a,b)=GCF(b, a mod b)",
        "methods": {
          "factor": {
            "available": true,
            "result": 9,
            "matches": true
          },
          "prime": {
            "available": true,
            "result": 9,
            "matches": true
          },
          "euclidean": {
            "available": true,
            "result": 9,
            "matches": true
          },
          "agree": true,
          "independent_count": 3
        },
        "work": {
          "factors": [
            "--- Factors ---",
            "18: 1, 2, 3, 6, [9], 18",
            "27: 1, 3, [9], 27",
            "Largest common factor: 9"
          ],
          "primes": [
            "--- Prime factorization ---",
            "18 = 2 × 3 × 3",
            "27 = 3 × 3 × 3",
            "Shared primes: 3^2 = 9"
          ],
          "euclidean": [
            "--- Euclidean algorithm ---",
            "27 = 1 × 18 + 9",
            "18 = 2 × 9 + 0",
            "Last nonzero remainder → GCF = 9"
          ]
        },
        "max_digits": 48
      },
      "tol": 0
    },
    {
      "id": "with-zero",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "values": [
          5,
          0
        ]
      },
      "expect": {
        "value": 5
      },
      "expectWarning": null,
      "actual": {
        "values": [
          5,
          0
        ],
        "value": 5,
        "exact": "5",
        "count": 2,
        "formula": "GCF(a,b,c,…) = GCF(GCF(a,b),c,…)",
        "binary_formula": "GCF(a,b)=GCF(b, a mod b)",
        "methods": {
          "factor": {
            "available": true,
            "result": 5,
            "matches": true
          },
          "prime": {
            "available": true,
            "result": 5,
            "matches": true
          },
          "euclidean": {
            "available": true,
            "result": 5,
            "matches": true
          },
          "agree": true,
          "independent_count": 3
        },
        "work": {
          "factors": [
            "--- Factors ---",
            "5: 1, [5]",
            "0: every nonzero integer divides 0",
            "Largest common factor: 5"
          ],
          "primes": [],
          "euclidean": [
            "--- Euclidean algorithm ---",
            "GCF(5, 0) = 5"
          ]
        },
        "max_digits": 48
      },
      "tol": 0
    },
    {
      "id": "zero-zero-5",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "values": [
          0,
          0,
          5
        ]
      },
      "expect": {
        "value": 5
      },
      "expectWarning": null,
      "actual": {
        "values": [
          0,
          0,
          5
        ],
        "value": 5,
        "exact": "5",
        "count": 3,
        "formula": "GCF(a,b,c,…) = GCF(GCF(a,b),c,…)",
        "binary_formula": "GCF(a,b)=GCF(b, a mod b)",
        "methods": {
          "factor": {
            "available": true,
            "result": 5,
            "matches": true
          },
          "prime": {
            "available": true,
            "result": 5,
            "matches": true
          },
          "euclidean": {
            "available": true,
            "result": 5,
            "matches": true
          },
          "agree": true,
          "independent_count": 3
        },
        "work": {
          "factors": [
            "--- Factors ---",
            "0: every nonzero integer divides 0",
            "0: every nonzero integer divides 0",
            "5: 1, [5]",
            "Largest common factor: 5"
          ],
          "primes": [],
          "euclidean": [
            "--- Euclidean algorithm ---",
            "GCF of many = fold pairwise: GCF(GCF(…), next)",
            "GCF(0, 0):",
            "  GCF(0, 0) = 0",
            "  → 0",
            "GCF(0, 5):",
            "  GCF(5, 0) = 5",
            "  → 5"
          ]
        },
        "max_digits": 48
      },
      "tol": 0
    },
    {
      "id": "bigint-unsafe",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "values": [
          "9007199254740993",
          3
        ]
      },
      "expect": {
        "value": 3
      },
      "expectWarning": null,
      "actual": {
        "values": [
          "9007199254740993",
          3
        ],
        "value": 3,
        "exact": "3",
        "count": 2,
        "formula": "GCF(a,b,c,…) = GCF(GCF(a,b),c,…)",
        "binary_formula": "GCF(a,b)=GCF(b, a mod b)",
        "methods": {
          "factor": {
            "available": false,
            "result": null
          },
          "prime": {
            "available": false,
            "result": null
          },
          "euclidean": {
            "available": true,
            "result": 3,
            "matches": true
          },
          "agree": true,
          "independent_count": 1
        },
        "work": {
          "factors": [],
          "primes": [],
          "euclidean": [
            "--- Euclidean algorithm ---",
            "9007199254740993 = 3002399751580331 × 3 + 0",
            "Last nonzero remainder → GCF = 3"
          ]
        },
        "max_digits": 48
      },
      "tol": 0
    },
    {
      "id": "numsInput",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "numsInput": "8, 12, 20"
      },
      "expect": {
        "value": 4
      },
      "expectWarning": null,
      "actual": {
        "values": [
          8,
          12,
          20
        ],
        "value": 4,
        "exact": "4",
        "count": 3,
        "formula": "GCF(a,b,c,…) = GCF(GCF(a,b),c,…)",
        "binary_formula": "GCF(a,b)=GCF(b, a mod b)",
        "methods": {
          "factor": {
            "available": true,
            "result": 4,
            "matches": true
          },
          "prime": {
            "available": true,
            "result": 4,
            "matches": true
          },
          "euclidean": {
            "available": true,
            "result": 4,
            "matches": true
          },
          "agree": true,
          "independent_count": 3
        },
        "work": {
          "factors": [
            "--- Factors ---",
            "8: 1, 2, [4], 8",
            "12: 1, 2, 3, [4], 6, 12",
            "20: 1, 2, [4], 5, 10, 20",
            "Largest common factor: 4"
          ],
          "primes": [
            "--- Prime factorization ---",
            "8 = 2 × 2 × 2",
            "12 = 2 × 2 × 3",
            "20 = 2 × 2 × 5",
            "Shared primes: 2^2 = 4"
          ],
          "euclidean": [
            "--- Euclidean algorithm ---",
            "GCF of many = fold pairwise: GCF(GCF(…), next)",
            "GCF(8, 12):",
            "  12 = 1 × 8 + 4",
            "  8 = 2 × 4 + 0",
            "  Last nonzero remainder → GCF = 4",
            "  → 4",
            "GCF(4, 20):",
            "  20 = 5 × 4 + 0",
            "  Last nonzero remainder → GCF = 4",
            "  → 4"
          ]
        },
        "max_digits": 48
      },
      "tol": 0
    },
    {
      "id": "boundary-all-zero-pair",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "values": [
          0,
          0
        ]
      },
      "expectError": "UNDEFINED",
      "code": "UNDEFINED",
      "error": "GCF of all zeros is undefined."
    },
    {
      "id": "boundary-all-zero-triple",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "values": [
          0,
          0,
          0
        ]
      },
      "expectError": "UNDEFINED",
      "code": "UNDEFINED",
      "error": "GCF of all zeros is undefined."
    },
    {
      "id": "boundary-one-number",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "values": [
          8
        ]
      },
      "expectError": "NEED_TWO_NUMBERS",
      "code": "NEED_TWO_NUMBERS",
      "error": "Enter at least two integers."
    },
    {
      "id": "boundary-missing",
      "ok": true,
      "kind": "boundary",
      "inputs": {},
      "expectError": "MISSING_REQUIRED_INPUT",
      "code": "MISSING_REQUIRED_INPUT",
      "error": "Enter at least two integers, separated by commas or spaces."
    },
    {
      "id": "boundary-non-integer",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "values": [
          8.5,
          12
        ]
      },
      "expectError": "INVALID_NUMBER",
      "code": "INVALID_NUMBER",
      "error": "Non-integers are rejected."
    },
    {
      "id": "boundary-alias-numsInput",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "numsInput": "8, 12, 20"
      },
      "expect": {
        "value": 4,
        "exact": "4"
      },
      "expectWarning": null,
      "actual": {
        "values": [
          8,
          12,
          20
        ],
        "value": 4,
        "exact": "4",
        "count": 3,
        "formula": "GCF(a,b,c,…) = GCF(GCF(a,b),c,…)",
        "binary_formula": "GCF(a,b)=GCF(b, a mod b)",
        "methods": {
          "factor": {
            "available": true,
            "result": 4,
            "matches": true
          },
          "prime": {
            "available": true,
            "result": 4,
            "matches": true
          },
          "euclidean": {
            "available": true,
            "result": 4,
            "matches": true
          },
          "agree": true,
          "independent_count": 3
        },
        "work": {
          "factors": [
            "--- Factors ---",
            "8: 1, 2, [4], 8",
            "12: 1, 2, 3, [4], 6, 12",
            "20: 1, 2, [4], 5, 10, 20",
            "Largest common factor: 4"
          ],
          "primes": [
            "--- Prime factorization ---",
            "8 = 2 × 2 × 2",
            "12 = 2 × 2 × 3",
            "20 = 2 × 2 × 5",
            "Shared primes: 2^2 = 4"
          ],
          "euclidean": [
            "--- Euclidean algorithm ---",
            "GCF of many = fold pairwise: GCF(GCF(…), next)",
            "GCF(8, 12):",
            "  12 = 1 × 8 + 4",
            "  8 = 2 × 4 + 0",
            "  Last nonzero remainder → GCF = 4",
            "  → 4",
            "GCF(4, 20):",
            "  20 = 5 × 4 + 0",
            "  Last nonzero remainder → GCF = 4",
            "  → 4"
          ]
        },
        "max_digits": 48
      },
      "tol": null
    },
    {
      "id": "boundary-bigint-unsafe",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "values": [
          "9007199254740993",
          "3"
        ]
      },
      "expect": {
        "value": 3
      },
      "expectWarning": null,
      "actual": {
        "values": [
          "9007199254740993",
          3
        ],
        "value": 3,
        "exact": "3",
        "count": 2,
        "formula": "GCF(a,b,c,…) = GCF(GCF(a,b),c,…)",
        "binary_formula": "GCF(a,b)=GCF(b, a mod b)",
        "methods": {
          "factor": {
            "available": false,
            "result": null
          },
          "prime": {
            "available": false,
            "result": null
          },
          "euclidean": {
            "available": true,
            "result": 3,
            "matches": true
          },
          "agree": true,
          "independent_count": 1
        },
        "work": {
          "factors": [],
          "primes": [],
          "euclidean": [
            "--- Euclidean algorithm ---",
            "9007199254740993 = 3002399751580331 × 3 + 0",
            "Last nonzero remainder → GCF = 3"
          ]
        },
        "max_digits": 48
      },
      "tol": null
    },
    {
      "id": "property-commutative-fold",
      "ok": true,
      "kind": "property",
      "detail": "GCF(8,12,20) = GCF(20,12,8) = 4",
      "expect": 4,
      "actual": 4
    },
    {
      "id": "property-three-methods-agree",
      "ok": true,
      "kind": "property",
      "detail": "factor, prime, and Euclidean all return 4",
      "expect": 4,
      "actual": 4
    },
    {
      "id": "property-ignore-zeros",
      "ok": true,
      "kind": "property",
      "detail": "GCF(0,0,12,20) = GCF(12,20)",
      "expect": 4,
      "actual": 4
    },
    {
      "id": "property-gcf-k-0",
      "ok": true,
      "kind": "property",
      "detail": "GCF(-48,0)=48",
      "expect": 48,
      "actual": 48
    },
    {
      "id": "property-bigint-beyond-safe-integer",
      "ok": true,
      "kind": "property",
      "detail": "GCF(9007199254740993, 3) = 3 (BigInt; IEEE-754 Number would round)",
      "expect": 3,
      "actual": 3
    },
    {
      "id": "property-pairwise-associative",
      "ok": true,
      "kind": "property",
      "detail": "GCF(GCF(48,18),30) = GCF(48,18,30)",
      "expect": 6,
      "actual": 6
    },
    {
      "id": "property-divides-each",
      "ok": true,
      "kind": "property",
      "detail": "4 divides 8, 12, and 20",
      "expect": 0,
      "actual": 0
    }
  ],
  "tier": "engine_tested",
  "verification": {
    "tests": {
      "passed": 20,
      "total": 20,
      "golden": 6,
      "boundary": 7,
      "property": 7
    },
    "contract_checks": {
      "passed": 3,
      "total": 3
    }
  },
  "evidence_core_generated_at": "2026-09-16T06:41:00.884Z",
  "rendered_at": "2026-09-16T22:03:43.771Z",
  "release_integrity": {
    "status": "verified",
    "scope": "workspace",
    "production_attestation_required": true,
    "calculation_version": "1.0.2",
    "artifacts": {
      "engine": "1.0.2",
      "page": "1.0.2",
      "capability": "1.0.2",
      "evidence": "1.0.2",
      "input_schema": "1.0.2",
      "output_schema": "1.0.2",
      "mcp_contract": "1.0.2"
    },
    "digests": {
      "input_schema_sha256": "937a6e502dea5e3c5dfc1ddc415dfe74551baf9c69172984c2beceac52db1c58",
      "output_schema_sha256": "0197666ba550d0fd10d924e139641734a798a04db1fcf2a2b5f25113ce68d993",
      "evidence_sha256": "5febc786dc57cd9e6f86474dd9b221089fc2fd3aff593cdfa6b7bbc8e705a91e",
      "evidence_core_sha256": "5febc786dc57cd9e6f86474dd9b221089fc2fd3aff593cdfa6b7bbc8e705a91e",
      "capability_sha256": "480da44000a80aba974f889efc9d64ab1f774d46e2139a31802de2df9ec8b600",
      "engine_sha256": "c8d4ccdbfeaf61d7b024d4e1babb0c2ba3b324c1b37bd0cb456a526d8d2b1bd1",
      "mcp_contract_sha256": "863098b311a7b17dc4b229a6302b90b3545b175f716e5d84772c7be8e9716b86"
    },
    "contract_checks": {
      "total": 3,
      "passed": 3,
      "failed": 0,
      "items": [
        {
          "id": "release-artifacts-aligned",
          "status": "pass",
          "detail": "1.0.2"
        },
        {
          "id": "schema-valid-input-executes",
          "status": "pass"
        },
        {
          "id": "engine-success-output-validates-schema",
          "status": "pass"
        }
      ]
    },
    "report": "https://www.calculatorx.com/.well-known/calculatorx-release-integrity.json"
  }
}
