{
  "category": "Math and trigonometry functions",
  "display_name": "PI",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.PI",
  "implementation_state": {
    "answer_bank": {
      "excel_builds": [
        "20430"
      ],
      "larger_numeric": 0,
      "last_bit": 0,
      "matched": 1,
      "other_mismatch": 0,
      "refused": 0,
      "rows": 1,
      "unread": 0,
      "worst_ulp": 0
    },
    "detail": "Recorded: 1 in the answer bank and 14 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 15 recorded answers",
    "workbook_corpus": {
      "cells": 14,
      "matched": 14
    }
  },
  "implementations": [
    {
      "commit": "9e1884369a678158dd82d3d74188daf986995e87",
      "flavour": "excel-compatibility-candidate",
      "language": "Rust",
      "name": "CalcFunc",
      "own_code": [
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/math.rs#L90-L90"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/math.rs#L90-L90",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 15 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.PI.json",
  "name": "PI",
  "notes": [],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n[RADIANS](FUNC.RADIANS.md) and [DEGREES](FUNC.DEGREES.md) convert angle units; they have their\nown arithmetic and rounding order. [SQRTPI](FUNC.SQRTPI.md) computes a function involving π.\nUse a higher-precision representation when the surrounding calculation needs more precision\nthan binary64 can retain.\n\n\n",
    "how-to-implement": "\nFor the recorded constant, construct binary64 from the 64-bit pattern `0x400921fb54442d18` or\nthe equivalent hexadecimal floating-point literal `0x1.921fb54442d18p+1`. Return a numeric value\nand reject an argument-bearing call at the formula boundary. Computing π through a platform\ninverse-trigonometric function adds an unnecessary dependency on that function's rounding.\n\nKeep a worksheet PI constant separate from a high-precision constant used inside trigonometric\nargument reduction. Reducing a large angle with only a rounded binary64 π loses information;\nmany-word reduction methods address a different problem from returning this worksheet constant.\n\n\n",
    "quirks": "\nMicrosoft's description gives π to fifteen significant decimal digits. Parsing that shorter\ndecimal, 3.14159265358979, produces binary64 `0x400921fb54442d11`, seven representable steps below\nthe recorded PI result. The description is not an instruction to store that truncated string.\n\nIdentities involving exact π need not hold exactly when evaluated with a rounded constant and\nrounded arithmetic. Multiplying or dividing this normal binary64 constant by 2 is exact in\nbinary arithmetic; dividing by 3 or 180 generally introduces another rounding.\n\nThe order of operations also matters: `x*PI()/180` and `x*(PI()/180)` round at different places.\nTheir mathematical equality does not imply identical numeric results.\n\n\n",
    "sources": "\n- [Microsoft: PI function](https://support.microsoft.com/en-us/excel/functions/pi-function).\n- Payne and Hanek, *Radian reduction for trigonometric functions* (1983).\n\n",
    "try-it": "\nCalculate `=PI()` to see the decimal and raw binary64 bits. Compare `=PI()-3.14159265358979` to\nsee why a decimal copied from a documentation display is not the same stored constant.\n\n\n",
    "version-differences": "The recorded environments below distinguish a reading from a same-input comparison. Counts describe captured inputs in each environment; overlapping captures and comparisons are not totals of unique worksheet calls.\n\n| Excel 16.0 build | Platform and CPU | Captured inputs |\n|---|---|---:|\n| 20430 | Windows, 64-bit, CPU not recorded | 1 |\n\nThe record contains no same-input comparison between these environments. Reading different inputs on different builds does not establish either a version change or cross-build agreement.\n\n[Recorded environments and comparison details](https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.PI.json).",
    "what-it-does": "\n`PI()` returns Excel's floating-point approximation to π, the ratio of a circle's circumference\nto its diameter. It takes no arguments. Use `PI()*radius^2` for a circle's area and `2*PI()*radius`\nfor its circumference when ordinary floating-point arithmetic is appropriate.\n\nIn the recorded Excel 16.0.20527.20088 capture, the returned binary64 is\n`0x400921fb54442d18`, approximately 3.141592653589793. This is the nearest binary64 value to π;\nit is still a finite approximation to an irrational number.\n\n\n"
  },
  "signature": {
    "display": "PI()",
    "parameters": [],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 0,
        "min": 0
      },
      "category": "Math and trigonometry functions",
      "classification": {
        "arg_preparation_profile": "ValuesOnlyPreAdapter",
        "coercion_lift_profile": "None",
        "determinism_class": "Deterministic",
        "error_collapse_profile": "None",
        "fec_dependency_profile": "None",
        "host_interaction_class": "None",
        "kernel_signature_class": "NullaryConst",
        "rich_value_usage": "RichBlind",
        "surface_fec_dependency_profile": "None",
        "thread_safety_class": "SafePure",
        "volatility_class": "NonVolatile"
      },
      "descriptions": {
        "long": null,
        "short": "The constant pi, 3.14159265358979",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns the value of pi",
        "microsoft_url": "https://support.microsoft.com/en-us/office/pi-function-264199d0-a3ba-46b8-975a-c4a04608989b"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "PI"
        },
        {
          "locale": "bg-BG",
          "name": "PI"
        },
        {
          "locale": "cs-CZ",
          "name": "PI"
        },
        {
          "locale": "da-DK",
          "name": "PI"
        },
        {
          "locale": "de-DE",
          "name": "PI"
        },
        {
          "locale": "el-GR",
          "name": "PI"
        },
        {
          "locale": "en-AU",
          "name": "PI"
        },
        {
          "locale": "en-GB",
          "name": "PI"
        },
        {
          "locale": "en-US",
          "name": "PI"
        },
        {
          "locale": "es-ES",
          "name": "PI"
        },
        {
          "locale": "et-EE",
          "name": "PI"
        },
        {
          "locale": "fi-FI",
          "name": "PII"
        },
        {
          "locale": "fr-FR",
          "name": "PI"
        },
        {
          "locale": "he-IL",
          "name": "PI"
        },
        {
          "locale": "hr-HR",
          "name": "PI"
        },
        {
          "locale": "hu-HU",
          "name": "PI"
        },
        {
          "locale": "id-ID",
          "name": "PI"
        },
        {
          "locale": "it-IT",
          "name": "PI.GRECO"
        },
        {
          "locale": "ja-JP",
          "name": "PI"
        },
        {
          "locale": "ko-KR",
          "name": "PI"
        },
        {
          "locale": "lt-LT",
          "name": "PI"
        },
        {
          "locale": "lv-LV",
          "name": "PI"
        },
        {
          "locale": "nb-NO",
          "name": "PI"
        },
        {
          "locale": "nl-NL",
          "name": "PI"
        },
        {
          "locale": "pl-PL",
          "name": "PI"
        },
        {
          "locale": "pt-BR",
          "name": "PI"
        },
        {
          "locale": "pt-PT",
          "name": "PI"
        },
        {
          "locale": "ro-RO",
          "name": "PI"
        },
        {
          "locale": "ru-RU",
          "name": "ПИ"
        },
        {
          "locale": "sk-SK",
          "name": "PI"
        },
        {
          "locale": "sl-SI",
          "name": "PI"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "PI"
        },
        {
          "locale": "sv-SE",
          "name": "PI"
        },
        {
          "locale": "th-TH",
          "name": "PI"
        },
        {
          "locale": "tr-TR",
          "name": "Pİ"
        },
        {
          "locale": "uk-UA",
          "name": "PI"
        },
        {
          "locale": "vi-VN",
          "name": "PI"
        },
        {
          "locale": "zh-CN",
          "name": "PI"
        },
        {
          "locale": "zh-HK",
          "name": "PI"
        },
        {
          "locale": "zh-TW",
          "name": "PI"
        }
      ],
      "signature": {
        "display": "PI()",
        "parameters": [],
        "trailing_repeats": false
      },
      "surface_name": "PI",
      "version_marker": null,
      "xlcall": {
        "code": "19",
        "symbol": "xlfPi"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/pi-function-264199d0-a3ba-46b8-975a-c4a04608989b"
  },
  "try_it": {
    "formula": "=PI()"
  },
  "url": "https://handbook.dnacalc.com/functions/PI.html",
  "variants": [],
  "versions": [
    {
      "behaviour": "The formulas below were read directly from Excel in the named capture. These rows do not establish behaviour on other builds or on unmeasured inputs.",
      "capture": {
        "environment": {
          "channel": "current",
          "compatibility": "compat-1/calc-191029",
          "excel_build": "16.0.20527.20088",
          "numeric_environment": "excel-x86-64/cpu-x86-64",
          "settings": {
            "add_ins": "COM add-in Carousel.ExcelAddin connect=false;COM add-in Dna_78b015d8b23f56a68ecce694f11f8794_3 connect=false;COM add-in ExcelPlugInShell.PowerMapConnect connect=false;COM add-in ExcelVstoAddIn1 connect=false;COM add-in MicrosoftDataStreamerforExcel connect=false;COM add-in MsoTDAddin.Connect.1 connect=false;COM add-in NativeShim.InquireConnector.1 connect=false;COM add-in OxVbaExcelAddin.ExcelAddin connect=false;COM add-in PDFMaker.OfficeAddin connect=false;COM add-in PowerPivotExcelClientAddIn.NativeEntry.1 connect=false;COM add-in TestComAddIn.ComAddIn connect=false;COM add-in TestRibbonRegistration.MyCustomRibbon connect=false;COM add-in VS15ExcelAdaptor connect=true;COM add-in xlPerf connect=false;add-in ANALYS32.XLL open=false installed=false;add-in ATPVBAEN.XLAM open=false installed=false;add-in CsTest160PR-AddIn64-packed.xll open=false installed=false;add-in CsTest160PR-AddIn64-packed.xll open=false installed=false;add-in EUROTOOL.XLAM open=false installed=false;add-in ExcelDna.IntelliSense.Tools-AddIn64.xll open=false installed=false;add-in ExcelDna.IntelliSense64.xll open=false installed=false;add-in GENERIC.xll open=false installed=false;add-in McpExcel-AddIn64.xll open=false installed=true;add-in TestIntelliEmbed-AddIn64.xll open=false installed=false;add-in ExcelDna64.xll open=false installed=false;add-in RibbonTest-AddIn64.xll open=false installed=false;add-in SOLVER.XLAM open=false installed=false;add-in Test160rc1Local-AddIn64.xll open=false installed=false;add-in TestCrashGuard-AddIn64.xll open=false installed=true;add-in TestCs170rc2-AddIn64.xll open=false installed=false;add-in TestDoc170-AddIn64.xll open=false installed=false;add-in TestOpen16-AddIn64-packed.xll open=false installed=false",
            "add_ins_installed": "McpExcel-AddIn64.xll;TestCrashGuard-AddIn64.xll",
            "ask_to_update_links": "false",
            "automation_security": "3",
            "calculation": "automatic",
            "calculation_clock": "40e69f3576e7e4f0",
            "calculation_state": "done",
            "calculation_version": "191029",
            "channel_source": "http://officecdn.microsoft.com/pr/492350f6-3a01-4f97-b9c0-c7c6ddf67d60",
            "com_add_ins_connected": "VS15ExcelAdaptor|Visual Studio Tools for Office Design-Time Adaptor for Excel",
            "connections": "",
            "country_code": "1",
            "country_setting": "27",
            "cpu": "AMD Ryzen 7 4800H with Radeon Graphics         ",
            "cpu_architecture": "AMD64",
            "date1904": "false",
            "date_order": "2",
            "date_separator": "/",
            "decimal_separator": ".",
            "display_alerts": "false",
            "enable_events": "false",
            "excel_build_number": "20527",
            "excel_machine": "x86-64",
            "excel_version": "16.0",
            "external_links": "",
            "has_vb_project": "false",
            "ignore_remote_requests": "false",
            "install_language_id": "7177",
            "interactive": "false",
            "iteration": "false",
            "list_separator": ",",
            "max_change": "3f50624dd2f1a9fc",
            "max_iterations": "100",
            "ole_dde_links": "",
            "opened_read_only": "true",
            "operating_system": "Windows (64-bit) NT 10.00",
            "os_version": "Microsoft Windows NT 10.0.26200.0",
            "precision_as_displayed": "false",
            "processor_count": "16",
            "thousands_separator": " ",
            "ui_language_id": "1033",
            "use_system_separators": "true",
            "user_culture": "en-ZA",
            "workbook_calculation_version": "191029",
            "workbook_compatibility_version": "1",
            "workbook_path": "C:\\Work\\DnaCalc\\DnaCalc-win\\target\\c\\20261103140553-2\\in\\oracle.xlsx"
          }
        },
        "path": "crates/calc-func/tests/captures/catalogue/sections/prefix_metadata.capture.json",
        "repository_revision": "96fc6795f714b4530bdaa0a5276fe08059937869",
        "session": {
          "context": "excel-calc-context/1;date1904=false;iteration=false;max_iterations=100;max_change=3f50624dd2f1a9fc;precision_as_displayed=false",
          "failures": [],
          "operations": [],
          "packages": {
            "input": "sha256:2839ad05d9e4d79e442cd2f90b8482aeef01da61cd2c3df5d82cd0143cec94b1",
            "output": "sha256:25d6375bb2d782db496d854e3db6744b6e201edb8c514adebc3af822a53f6e72"
          },
          "revision": 0,
          "tool": "calc-oracle-excel 0.1.0; worker results 1; worker sha256:b8c1c482f73b050effc0a22e2a70b34e13ae71ea8a073e5e209d7e6dc0666439; repository 5050897870296b3b3a8dc45d8c8ded97c4c764d6+dirty"
        },
        "sha256": "006596fd685a89215ef4bd4f9e64e6a8da5e314e6711305be51a0ff8a0700b18"
      },
      "excel_build": "16.0.20527.20088",
      "observations": [
        {
          "call": "=PI()",
          "excel": {
            "bits": "0x400921fb54442d18",
            "display": "3.141592653589793",
            "kind": "number"
          },
          "input_route": "formula-literal",
          "inputs": [],
          "recorded_in": "Excel 16.0.20527.20088, Windows (64-bit) NT 10.00, AMD Ryzen 7 4800H with Radeon Graphics, en-ZA; workbook compatibility 1",
          "source_locator": {
            "column": 1,
            "row": 182,
            "sheet": "prefix_metadata"
          }
        },
        {
          "call": "=PI()",
          "excel": {
            "bits": "0x400921fb54442d18",
            "display": "3.141592653589793",
            "kind": "number"
          },
          "input_route": "formula-literal",
          "inputs": [],
          "recorded_in": "Excel 16.0.20527.20088, Windows (64-bit) NT 10.00, AMD Ryzen 7 4800H with Radeon Graphics, en-ZA; workbook compatibility 1",
          "source_locator": {
            "column": 2,
            "row": 182,
            "sheet": "prefix_metadata"
          }
        }
      ],
      "platform": "Windows (64-bit) NT 10.00, AMD Ryzen 7 4800H with Radeon Graphics, en-ZA",
      "sources": [
        "https://github.com/DnaCalc/DnaCalc/blob/96fc6795f714b4530bdaa0a5276fe08059937869/crates/calc-func/tests/captures/catalogue/sections/prefix_metadata.capture.json"
      ]
    },
    {
      "behaviour": "1 captured inputs are indexed for this environment. Capture dates: 2026-09-29 to 2026-09-29. This is a reading count, not a comparison with another build.",
      "excel_build": "16.0 build 20430",
      "platform": "Windows, 64-bit, CPU not recorded",
      "sources": [
        "https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.PI.json"
      ]
    }
  ]
}