{
  "schemaVersion": 1,
  "slug": "exponent-calculator",
  "category": "math",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "10faddf575e2d58f858e9022d9b881404fd4f12e587a417a7b808fccc7e12102",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/exponent-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "y = b^x; 1 ÷ y; r = b^(1 ÷ x)",
    "vars": [
      [
        "b",
        "base"
      ],
      [
        "x",
        "exponent"
      ],
      [
        "y",
        "power result"
      ],
      [
        "r",
        "root of the base"
      ]
    ],
    "note": "Non-finite powers and negative bases with fractional exponents return an error; 0 to a negative power is undefined. Inverse is null for a zero result; the reciprocal-exponent root is undefined when x = 0. Numeric outputs are rounded for display."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const integerExponent=Number.isInteger(exponent);const raw=(base<0&&!integerExponent)||(base===0&&exponent<0)?NaN:Math.pow(base,exponent);if(!Number.isFinite(raw)||(raw===0&&base!==0))return{result:null,inverse:null,root:null,__error:'inputError'};const result=raw;let rawRoot=NaN;if(exponent!==0&&base>=0)rawRoot=Math.pow(base,1/exponent);else if(exponent!==0&&base<0&&integerExponent&&Math.abs(exponent)%2===1)rawRoot=-Math.pow(Math.abs(base),1/exponent);const inverse=result!==0?1/result:null;return{result,inverse,root:Number.isFinite(rawRoot)?rawRoot:null};",
    "inputs": [
      {
        "name": "base",
        "type": "number",
        "default": 2,
        "min": -1000,
        "max": 1000,
        "step": 0.01
      },
      {
        "name": "exponent",
        "type": "number",
        "default": 10,
        "min": -100,
        "max": 100,
        "step": 0.01
      }
    ],
    "outputs": [
      {
        "name": "result",
        "precision": 6,
        "unit": ""
      },
      {
        "name": "inverse",
        "precision": 8,
        "unit": ""
      },
      {
        "name": "root",
        "precision": 6,
        "unit": "",
        "optional": true
      }
    ],
    "interpret": null
  }
}
