{
  "capability_id": "math.percentage",
  "tool_id": "percentage",
  "engine": "percentage",
  "calculation_version": "1.1.1",
  "generated_at": "2026-09-16T22:03:43.774Z",
  "engine_build": "2026-09-10",
  "test_count": 19,
  "passed": 19,
  "failed": 0,
  "tests_summary": {
    "golden": {
      "total": 12,
      "passed": 12
    },
    "boundary": {
      "total": 7,
      "passed": 7
    },
    "property": {
      "total": 0,
      "passed": 0
    }
  },
  "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/percentage",
  "api": "https://www.calculatorx.com/api/v1/calc/percentage",
  "schema_input": "https://www.calculatorx.com/schemas/math.percentage.input.json",
  "schema_output": "https://www.calculatorx.com/schemas/math.percentage.output.json",
  "assumptions": [
    "Interactive evaluation runs locally in the browser. Shared URLs and REST evaluate the same versioned engine (query SSR).",
    "Denominators (whole, old, average of A and B, P) must be nonzero where required.",
    "Percent change uses |old| in the denominator (signed increase/decrease). Typically used with a nonzero baseline; old = 0 is undefined.",
    "Percentage difference is defined for A ≥ 0, B ≥ 0, and A+B ≠ 0."
  ],
  "limitations": [
    "Percent change uses |old| denominator; old = 0 undefined",
    "Percentage difference requires non-negative a, b → VALUE_MUST_BE_NON_NEGATIVE",
    "Missing fields → MISSING_REQUIRED_INPUT"
  ],
  "boundary_conditions": [
    "Division by zero → DIVISION_BY_ZERO",
    "Percentage difference with A < 0 or B < 0 → VALUE_MUST_BE_NON_NEGATIVE",
    "Unknown mode → INVALID_MODE"
  ],
  "sources": [
    {
      "title": "BIPM — The International System of Units (SI), 9th edition",
      "section": "Units accepted for use with the SI — percent (symbol %), 1% = 0.01",
      "url": "https://www.bipm.org/en/publications/si-brochure",
      "supports": "Defines percent as the number 0.01 (one part in one hundred). The core relation P% of X = X × P/100 follows from that definition.",
      "kind": "reference",
      "accessed": "2026-08-28"
    },
    {
      "title": "NIST Special Publication 811 — Guide for the Use of the International System of Units (SI)",
      "section": "Writing values of quantities — the percent",
      "url": "https://www.nist.gov/pml/special-publication-811",
      "supports": "NIST usage of percent as 0.01 with the SI. Does not prescribe percent-change vs percent-difference conventions.",
      "kind": "reference",
      "accessed": "2026-08-28"
    },
    {
      "title": "CalculatorX percentage conventions",
      "section": "Six phrase modes, |old| percent change, non-negative percentage difference",
      "supports": "Percent change Δ% = 100×(new−old)/|old| (undefined at old = 0). Percentage difference Δ% = 100×|A−B|/((A+B)/2) on A ≥ 0, B ≥ 0, A+B ≠ 0. Increase/decrease is X×(1±P/100).",
      "kind": "definition"
    }
  ],
  "methods": [],
  "fingerprint": "sha256:43a3601fe3d15428d83cc6f727320b8d989bb2e6bb877edd058c45853c2458a3",
  "tests": [
    {
      "id": "pct-of",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "of",
        "p": 20,
        "x": 250
      },
      "expect": 50,
      "expectWarning": null,
      "actual": {
        "mode": "of",
        "mode_label": "P% of X",
        "heading": "20% of 250",
        "value": 50,
        "unit": null,
        "display": {
          "value": "50"
        },
        "explainer": "20% of 250 equals 50.",
        "inputs_summary": "P=20% · X=250",
        "formula": "Y = X × P / 100",
        "steps": [
          "What is 20% of 250?",
          "Y = 250 × 20 / 100",
          "= 50"
        ],
        "status": "success",
        "calculation_version": "1.1.1",
        "P": 20,
        "X": 250,
        "Y": 50
      },
      "tol": 1e-9
    },
    {
      "id": "pct-of-share-aliases",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "of",
        "pInput": 20,
        "xInput": 250
      },
      "expect": 50,
      "expectWarning": null,
      "actual": {
        "mode": "of",
        "mode_label": "P% of X",
        "heading": "20% of 250",
        "value": 50,
        "unit": null,
        "display": {
          "value": "50"
        },
        "explainer": "20% of 250 equals 50.",
        "inputs_summary": "P=20% · X=250",
        "formula": "Y = X × P / 100",
        "steps": [
          "What is 20% of 250?",
          "Y = 250 × 20 / 100",
          "= 50"
        ],
        "status": "success",
        "calculation_version": "1.1.1",
        "P": 20,
        "X": 250,
        "Y": 50
      },
      "tol": 1e-9
    },
    {
      "id": "is-what",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "is-what",
        "x": 50,
        "y": 200
      },
      "expect": 25,
      "expectWarning": null,
      "actual": {
        "mode": "is-what",
        "mode_label": "X is what % of Y",
        "heading": "Percent",
        "value": 25,
        "unit": "%",
        "display": {
          "value": "25%"
        },
        "explainer": "50 is 25% of 200.",
        "inputs_summary": "X=50 · Y=200",
        "formula": "P = 100 × X / Y",
        "steps": [
          "50 is what % of 200?",
          "P = 100 × 50 / 200",
          "= 25%"
        ],
        "status": "success",
        "calculation_version": "1.1.1",
        "X": 50,
        "Y": 200,
        "P": 25
      },
      "tol": 1e-9
    },
    {
      "id": "ui-what",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "what",
        "x": 50,
        "y": 200
      },
      "expect": 25,
      "expectWarning": null,
      "actual": {
        "mode": "is-what",
        "mode_label": "X is what % of Y",
        "heading": "Percent",
        "value": 25,
        "unit": "%",
        "display": {
          "value": "25%"
        },
        "explainer": "50 is 25% of 200.",
        "inputs_summary": "X=50 · Y=200",
        "formula": "P = 100 × X / Y",
        "steps": [
          "50 is what % of 200?",
          "P = 100 × 50 / 200",
          "= 25%"
        ],
        "status": "success",
        "calculation_version": "1.1.1",
        "X": 50,
        "Y": 200,
        "P": 25
      },
      "tol": 1e-9
    },
    {
      "id": "of-what",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "of-what",
        "x": 12,
        "p": 20
      },
      "expect": 60,
      "expectWarning": null,
      "actual": {
        "mode": "of-what",
        "mode_label": "X is P% of what",
        "heading": "Whole",
        "value": 60,
        "unit": null,
        "display": {
          "value": "60"
        },
        "explainer": "12 is 20% of 60.",
        "inputs_summary": "X=12 · P=20%",
        "formula": "Y = 100 × X / P",
        "steps": [
          "12 is 20% of what?",
          "Y = 100 × 12 / 20",
          "= 60"
        ],
        "status": "success",
        "calculation_version": "1.1.1",
        "X": 12,
        "P": 20,
        "Y": 60
      },
      "tol": 1e-9
    },
    {
      "id": "change",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "change",
        "oldV": 40,
        "newV": 50
      },
      "expect": 25,
      "expectWarning": null,
      "actual": {
        "mode": "change",
        "mode_label": "Percent change",
        "heading": "Percent change",
        "value": 25,
        "unit": "%",
        "display": {
          "value": "25%"
        },
        "explainer": "increase: 40 → 50 is 25%.",
        "inputs_summary": "40 → 50",
        "formula": "Δ% = 100 × (new − old) / |old|",
        "steps": [
          "From 40 to 50",
          "Δ = 50 − 40 = 10",
          "% change = 10 / |40| × 100% = 10 / 40 × 100% = 25%"
        ],
        "status": "success",
        "calculation_version": "1.1.1",
        "oldV": 40,
        "newV": 50,
        "delta": 10,
        "percent_change": 25
      },
      "tol": 1e-9
    },
    {
      "id": "change-abs-old",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "change",
        "oldV": -100,
        "newV": -50
      },
      "expect": 50,
      "expectWarning": null,
      "actual": {
        "mode": "change",
        "mode_label": "Percent change",
        "heading": "Percent change",
        "value": 50,
        "unit": "%",
        "display": {
          "value": "50%"
        },
        "explainer": "increase: -100 → -50 is 50%.",
        "inputs_summary": "-100 → -50",
        "formula": "Δ% = 100 × (new − old) / |old|",
        "steps": [
          "From -100 to -50",
          "Δ = -50 − -100 = 50",
          "% change = 50 / |-100| × 100% = 50 / 100 × 100% = 50%"
        ],
        "status": "success",
        "calculation_version": "1.1.1",
        "oldV": -100,
        "newV": -50,
        "delta": 50,
        "percent_change": 50
      },
      "tol": 1e-9
    },
    {
      "id": "adjust-up",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "adjust-up",
        "x": 500,
        "p": 10
      },
      "expect": 550,
      "expectWarning": null,
      "actual": {
        "mode": "adjust-up",
        "mode_label": "Increase by %",
        "heading": "Increased value",
        "value": 550,
        "unit": null,
        "display": {
          "value": "550"
        },
        "explainer": "500 increased by 10% equals 550.",
        "inputs_summary": "X=500 · P=10%",
        "formula": "Y = X × (1 ± P/100)",
        "steps": [
          "500 increased by 10%",
          "Y = 500 × (1 + 10/100)",
          "= 550"
        ],
        "status": "success",
        "calculation_version": "1.1.1",
        "X": 500,
        "P": 10,
        "Y": 550,
        "dir": "increase"
      },
      "tol": 1e-9
    },
    {
      "id": "adjust-down",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "adjust-down",
        "x": 500,
        "p": 10
      },
      "expect": 450,
      "expectWarning": null,
      "actual": {
        "mode": "adjust-down",
        "mode_label": "Decrease by %",
        "heading": "Decreased value",
        "value": 450,
        "unit": null,
        "display": {
          "value": "450"
        },
        "explainer": "500 decreased by 10% equals 450.",
        "inputs_summary": "X=500 · P=10%",
        "formula": "Y = X × (1 ± P/100)",
        "steps": [
          "500 decreased by 10%",
          "Y = 500 × (1 − 10/100)",
          "= 450"
        ],
        "status": "success",
        "calculation_version": "1.1.1",
        "X": 500,
        "P": 10,
        "Y": 450,
        "dir": "decrease"
      },
      "tol": 1e-9
    },
    {
      "id": "difference",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "difference",
        "a": 10,
        "b": 6
      },
      "expect": 50,
      "expectWarning": null,
      "actual": {
        "mode": "difference",
        "mode_label": "Percent difference",
        "heading": "Percent difference",
        "value": 50,
        "unit": "%",
        "display": {
          "value": "50%"
        },
        "explainer": "Relative difference of 10 and 6 is 50% of their average.",
        "inputs_summary": "A=10 · B=6",
        "formula": "Δ% = 100 × |A − B| / ((A + B) / 2)",
        "steps": [
          "|10 − 6| = 4",
          "Average = (10 + 6) / 2 = 8",
          "% difference = 4 / 8 × 100% = 50%"
        ],
        "status": "success",
        "calculation_version": "1.1.1",
        "A": 10,
        "B": 6,
        "average": 8,
        "percent_difference": 50
      },
      "tol": 1e-9
    },
    {
      "id": "diff-negative",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "difference",
        "a": -10,
        "b": 10
      },
      "expectError": "VALUE_MUST_BE_NON_NEGATIVE",
      "code": "VALUE_MUST_BE_NON_NEGATIVE",
      "error": "Percentage difference is defined for A ≥ 0 and B ≥ 0."
    },
    {
      "id": "change-old-0",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "change",
        "oldV": 0,
        "newV": 10
      },
      "expectError": "DIVISION_BY_ZERO",
      "code": "DIVISION_BY_ZERO",
      "error": "Old value cannot be 0."
    },
    {
      "id": "is-what-y-0",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "is-what",
        "x": 5,
        "y": 0
      },
      "expectError": "DIVISION_BY_ZERO",
      "code": "DIVISION_BY_ZERO",
      "error": "Whole Y cannot be 0."
    },
    {
      "id": "of-what-p-0",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "of-what",
        "x": 12,
        "p": 0
      },
      "expectError": "DIVISION_BY_ZERO",
      "code": "DIVISION_BY_ZERO",
      "error": "Percent P cannot be 0."
    },
    {
      "id": "diff-both-zero",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "difference",
        "a": 0,
        "b": 0
      },
      "expectError": "DIVISION_BY_ZERO",
      "code": "DIVISION_BY_ZERO",
      "error": "A + B cannot be 0 (the average in the denominator would be 0)."
    },
    {
      "id": "of-nan",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "of",
        "p": "NaN",
        "x": 250
      },
      "expectError": "INVALID_NUMBER",
      "code": "INVALID_NUMBER",
      "error": "Invalid percent P: “NaN”."
    },
    {
      "id": "of-huge",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "of",
        "p": 20,
        "x": 1000000000000000
      },
      "expect": 200000000000000,
      "expectWarning": null,
      "actual": {
        "mode": "of",
        "mode_label": "P% of X",
        "heading": "20% of 1.000000e+15",
        "value": 200000000000000,
        "unit": null,
        "display": {
          "value": "2.000000e+14"
        },
        "explainer": "20% of 1.000000e+15 equals 2.000000e+14.",
        "inputs_summary": "P=20% · X=1.000000e+15",
        "formula": "Y = X × P / 100",
        "steps": [
          "What is 20% of 1.000000e+15?",
          "Y = 1.000000e+15 × 20 / 100",
          "= 2.000000e+14"
        ],
        "status": "success",
        "calculation_version": "1.1.1",
        "P": 20,
        "X": 1000000000000000,
        "Y": 200000000000000
      },
      "tol": 0.000001
    },
    {
      "id": "change-tiny",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "change",
        "oldV": 1e-8,
        "newV": 2e-8
      },
      "expect": 100,
      "expectWarning": null,
      "actual": {
        "mode": "change",
        "mode_label": "Percent change",
        "heading": "Percent change",
        "value": 100,
        "unit": "%",
        "display": {
          "value": "100%"
        },
        "explainer": "increase: 1.000000e-8 → 2.000000e-8 is 100%.",
        "inputs_summary": "1.000000e-8 → 2.000000e-8",
        "formula": "Δ% = 100 × (new − old) / |old|",
        "steps": [
          "From 1.000000e-8 to 2.000000e-8",
          "Δ = 2.000000e-8 − 1.000000e-8 = 1.000000e-8",
          "% change = 1.000000e-8 / |1.000000e-8| × 100% = 1.000000e-8 / 1.000000e-8 × 100% = 100%"
        ],
        "status": "success",
        "calculation_version": "1.1.1",
        "oldV": 1e-8,
        "newV": 2e-8,
        "delta": 1e-8,
        "percent_change": 100
      },
      "tol": 1e-9
    },
    {
      "id": "boundary-pct-diff-neg",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "difference",
        "a": -1,
        "b": 2
      },
      "expectError": "VALUE_MUST_BE_NON_NEGATIVE",
      "code": "VALUE_MUST_BE_NON_NEGATIVE",
      "error": "Percentage difference is defined for A ≥ 0 and B ≥ 0."
    }
  ],
  "tier": "engine_tested",
  "verification": {
    "tests": {
      "passed": 19,
      "total": 19,
      "golden": 12,
      "boundary": 7,
      "property": 0
    },
    "contract_checks": {
      "passed": 3,
      "total": 3
    }
  },
  "evidence_core_generated_at": "2026-09-10T22:48:17.762Z",
  "rendered_at": "2026-09-16T22:03:43.774Z",
  "release_integrity": {
    "status": "verified",
    "scope": "workspace",
    "production_attestation_required": true,
    "calculation_version": "1.1.1",
    "artifacts": {
      "engine": "1.1.1",
      "page": "1.1.1",
      "capability": "1.1.1",
      "evidence": "1.1.1",
      "input_schema": "1.1.1",
      "output_schema": "1.1.1",
      "mcp_contract": "1.1.1"
    },
    "digests": {
      "input_schema_sha256": "188e4f67b78437338e3f56cb4e7e82003b521697af6707b04fa75321ca920f39",
      "output_schema_sha256": "14cbd02203cf735e07c23bf387ea886fc53cd9e9419602643dd6d69f34d95c56",
      "evidence_sha256": "550b5ff131971e5a6dbdf40fa5af260e275136a0577f9e6f3869bba4e072f732",
      "evidence_core_sha256": "550b5ff131971e5a6dbdf40fa5af260e275136a0577f9e6f3869bba4e072f732",
      "capability_sha256": "704c96315423625b0ea94343d56c46e4b1dbade2af0a666147410a41a8a1ed23",
      "engine_sha256": "c8d4ccdbfeaf61d7b024d4e1babb0c2ba3b324c1b37bd0cb456a526d8d2b1bd1",
      "mcp_contract_sha256": "863098b311a7b17dc4b229a6302b90b3545b175f716e5d84772c7be8e9716b86"
    },
    "contract_checks": {
      "total": 3,
      "passed": 3,
      "failed": 0,
      "items": [
        {
          "id": "release-artifacts-aligned",
          "status": "pass",
          "detail": "1.1.1"
        },
        {
          "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"
  }
}
