{
  "schemaVersion": 1,
  "slug": "logarithm-calculator",
  "category": "math",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "fe83ef10f16da39a4a6d2a3019b5f9265ad69a0e0e0f56a6726bf8f3fddf3383",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/logarithm-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": "log_b(x) = ln(x) ÷ ln(b); log10(x) = ln(x) ÷ ln(10); log2(x) = ln(x) ÷ ln(2)",
    "vars": [
      [
        "x",
        "argument (value)"
      ],
      [
        "b",
        "logarithm base"
      ],
      [
        "log",
        "base-b logarithm"
      ],
      [
        "ln",
        "natural logarithm"
      ]
    ],
    "note": "Requires value > 0, base > 0 and base ≠ 1; logarithm output is the exponent whose power reproduces value."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "return{log:Math.log(value)/Math.log(base),naturalLog:Math.log(value),log10:Math.log10(value),log2:Math.log2(value)};",
    "inputs": [
      {
        "name": "value",
        "type": "number",
        "default": 1000,
        "min": 1e-12,
        "max": 1000000000000000,
        "step": 0.0001
      },
      {
        "name": "base",
        "type": "number",
        "default": 10,
        "min": 1.000001,
        "max": 1000,
        "step": 0.01
      }
    ],
    "outputs": [
      {
        "name": "log",
        "precision": 6,
        "unit": ""
      },
      {
        "name": "naturalLog",
        "precision": 6,
        "unit": ""
      },
      {
        "name": "log10",
        "precision": 6,
        "unit": ""
      },
      {
        "name": "log2",
        "precision": 6,
        "unit": ""
      }
    ],
    "interpret": null
  }
}
