{
  "category": "Math and trigonometry functions",
  "display_name": "LOG10",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.LOG10",
  "implementation_state": {
    "answer_bank": {
      "excel_builds": [
        "20430"
      ],
      "larger_numeric": 0,
      "last_bit": 0,
      "matched": 2823,
      "other_mismatch": 0,
      "refused": 0,
      "rows": 2823,
      "unread": 0,
      "worst_ulp": 0
    },
    "detail": "Recorded: 2,823 in the answer bank and 43 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 2,866 recorded answers",
    "workbook_corpus": {
      "cells": 43,
      "matched": 43
    }
  },
  "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#L106-L106"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/math::unary",
        "ported/log10_fn::log10_kernel"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/math.rs#L106-L106",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 2,866 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.LOG10.json",
  "name": "LOG10",
  "notes": [],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n### Relationships\n\n- **[LN](FUNC.LN.md)** — the natural logarithm; `LOG10` is `LN` scaled by log₁₀(e). Both are\n  subjects of the same evidence record and share the substrate identified there.\n- **`POWER(10, y)`** — the inverse. `POWER(10, LOG10(x))` returning *x* exactly is a stronger\n  requirement than either function meets in general.\n- **There is no real `LOG2` in Excel.** Base 2 goes through `LOG(x, 2)`. Given how often base-2\n  logarithms appear in sizing and information-theoretic calculations, this is a notable absence,\n  and the complex-valued `IMLOG2` exists while the real one does not.\n- **`INT(LOG10(n)) + 1` for the digit count** is the single most common use of this function and\n  the single most common way to get a wrong answer from it — see below.\n\n\n",
    "how-to-implement": "\n### Numerical notes\n\n\n**The scaled-kernel advantage.** A dedicated base-10 logarithm folds the constant log₁₀(e) into\nthe polynomial evaluation instead of dividing by ln 10 afterwards, which removes one rounding and\n— more importantly — removes the error in the *representation* of ln 10. The standard fdlibm-family\narrangement is the one described on the [LN](FUNC.LN.md) page (extract the exponent *k*, reduce the\nsignificand to a neighbourhood of 1, evaluate an odd polynomial in the artanh variable) with the\nfinal combination performed as\n\n    log₁₀ x = k · log₁₀2_hi + (k · log₁₀2_lo + log₁₀(e) · ln m)\n\nwhere log₁₀2 is carried as a two-part Cody–Waite constant so the exponent term stays exact. Sun's\nfdlibm `e_log10.c` is the canonical source; Cephes and most current libm implementations descend\nfrom it. Muller's *Elementary Functions* gives the error analysis; Abramowitz & Stegun chapter 4,\nsection 4.1 tabulates the underlying relations.\n\n**Exactness on powers of ten is not free.** log₁₀(10^k) = *k* is trivially true in mathematics\nand delicate in binary64:\n\n1. For 0 ≤ *k* ≤ 22, 10^k is exactly representable, and a good implementation returns exactly *k*.\n2. For larger *k*, 10^k is **not** exactly representable — the stored double is a near neighbour —\n   so the mathematically correct answer for the *stored value* is not the integer *k*, and an\n   implementation that returns *k* is arguably rounding to what the user meant rather than what\n   they wrote. Both behaviours are defensible; they are different functions.\n3. A quotient `ln(x)/ln(10)` will generally miss the integer even in case 1, because neither\n   logarithm is exact and their ratio is not.\n\n**The digit-count trap.** `INT(LOG10(n)) + 1` is the textbook decimal-digit count, and it fails\nwhenever `LOG10` of an exact power of ten comes back a hair below the integer: the floor then\ndrops a whole digit, and the formula reports that 1000 has three digits. This is the\n[INT](FUNC.INT.md) amplification hazard in its most common concrete form — a sub-ULP error in the\nargument of a discontinuous function becoming a whole-unit error in the answer. The robust\nworksheet forms are `LEN(TEXT(n,\"0\"))` for integers, or `INT(LOG10(n) + 0.5*10^-9) + 1` with a\ndeliberate, documented tolerance. The fragile form is the one everybody writes.\n\n**Relative accuracy near x = 1.** As with `LN`, the result passes through zero at *x* = 1, so\nrelative error is unbounded there for any implementation. Absolute accuracy remains excellent;\nthe two must not be confused when reading an accuracy claim.\n\n**The host-CPU caveat** attached to this page's evidence record applies here as it does to `LN`\nand `LOG`: the substrate identified upstream is a legacy x87 transcendental sequence whose last\nbit is microcode, so bit-level agreement is scoped to a machine as well as to a build.\n\n\n",
    "quirks": "\n### Result and edge cases\n\n\nReturns `Number`.\n\n- **Zero and negative arguments** produce `#NUM!`.\n- **`LOG10(TRUE)`** converts the logical to 1 and returns zero. Undocumented conversion.\n- **Numeric text** converts and evaluates.\n- **The largest finite double** and **the smallest positive subnormal** produce finite results,\n  both host-scoped. Note that the base-10 logarithm compresses the entire positive double range\n  into roughly the interval from −324 to +309, which is why `LOG10` is the natural function for\n  talking about magnitude.\n- **An inline array** lifts elementwise.\n- **An empty range** produces `#VALUE!`.\n\n",
    "sources": "- Microsoft, \"LOG10 function\" —\n  <https://support.microsoft.com/en-us/office/log10-function-c75b881b-49dd-44fb-b6f4-37e3486a0211>.\n  Retrieved for this page: the syntax, the \"positive real number\" argument description, the gloss\n  of the result as the power 10 is raised to, and the four worked examples including the two that\n  assert an exact 5. The page as retrieved states no error value.\n- Handbook evidence record `EV-MATH-0001` — live-Excel sweep naming `LOG10` as a subject; carries\n  the host-CPU caveat, the per-surface/group distinction with an explicit prohibition on\n  attributing the group figures here, and the substrate identification.\n- M. Abramowitz and I. A. Stegun, *Handbook of Mathematical Functions*, chapter 4, section 4.1.\n- Sun Microsystems fdlibm, `e_log10.c` — the canonical scaled-kernel arrangement described above;\n  W. J. Cody and W. Waite, *Software Manual for the Elementary Functions*, for the two-part\n  constant technique; J.-M. Muller, *Elementary Functions*, 3rd edition, for the error analysis.\n- Handbook, [LN](FUNC.LN.md) and [INT](FUNC.INT.md) — the shared kernel, and the amplification\n  hazard behind the digit-count trap.\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| 19929 | Windows, bitness not recorded, CPU not recorded | 43 |\n| 20430 | Windows, 64-bit, CPU not recorded | 2,823 |\n\n- XC-LOG10-001: build 19929 versus build 20430; 2 same-input pairs, 0 differing answers. Compared axes: excel-build. Numeric answers were compared by their recorded binary64 bits; other answers by typed value.\n\nAgreement on these compared inputs does not establish agreement on unmeasured inputs.\n\n[Recorded environments and comparison details](https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.LOG10.json).",
    "what-it-does": "\n`LOG10(number)` returns the base-10 logarithm of a positive real number — \"the power to which\n10 must be raised to equal the given number\", in the documentation's own gloss.\n\n    LOG10(x) = log₁₀ x = ln x / ln 10 = log₁₀(e) · ln x,   x > 0\n\nwith log₁₀(e) = 0.4342944819032518…, the constant conventionally called M_LOG10E.\n\n**Domain and range.** Domain (0, ∞); range all of ℝ. Strictly increasing, concave, with the same\nlogarithmic singularity at 0⁺ and the same absence of any finite pole as [LN](FUNC.LN.md) — the\ntwo differ only by a positive constant factor, so every structural property transfers, including\nthe branch cut of the complex extension along the negative real axis.\n\n**What makes base 10 special is not the mathematics — it is the exactness readers expect.** For\ninteger *k*, log₁₀(10^k) = *k* exactly, and Microsoft's documented examples assert exactly that:\n`LOG10(100000)` and `LOG10(10^5)` are both shown as 5, and `LOG10(10)` as 1. Those are the\neasiest values to state and among the harder ones to compute, because 10^k for *k* > 22 is not\nexactly representable in binary64 and because a quotient of two inexact logarithms lands on an\ninteger only by luck. See \"Numerical notes\".\n\nThe useful identities:\n\n    log₁₀(ab) = log₁₀ a + log₁₀ b       log₁₀(xᵖ) = p · log₁₀ x\n    log₁₀ x = LN(x) / LN(10)            ⌊log₁₀ n⌋ + 1 = the number of decimal digits of n ≥ 1\n\nThe last is the reason `LOG10` appears in so many worksheets, and it is also the reason this page\nhas a warning in it.\n\n\n\n### Arguments\n\n\n| Argument | Meaning | Required |\n|---|---|---|\n| `number` | \"The positive real number for which you want the base-10 logarithm.\" | Yes |\n\nExactly one argument; the declared arity is one to one, and there is no base parameter — that is\nwhat [LOG](FUNC.LOG.md) is for. The slot is numeric and subject to ordinary to-number coercion\n([coercion and lifting](../model/02-coercion-and-lifting.md)); the declared coercion profile is\nthe unary numeric scalar-or-array-elementwise one, so `LOG10` is a scalar kernel that lifts over\narrays.\n\n\n"
  },
  "signature": {
    "display": "LOG10(number)",
    "parameters": [
      {
        "description": null,
        "name": "number",
        "optional": false,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 1,
        "min": 1
      },
      "category": "Math and trigonometry functions",
      "classification": {
        "arg_preparation_profile": "ValuesOnlyPreAdapter",
        "coercion_lift_profile": "UnaryNumericScalarOrArrayElementwise",
        "determinism_class": "Deterministic",
        "error_collapse_profile": "None",
        "fec_dependency_profile": "None",
        "host_interaction_class": "None",
        "kernel_signature_class": "Custom",
        "rich_value_usage": "RichBlind",
        "surface_fec_dependency_profile": "RefOnly",
        "thread_safety_class": "SafePure",
        "volatility_class": "NonVolatile"
      },
      "descriptions": {
        "long": null,
        "short": "Base-10 logarithm",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns the base-10 logarithm of a number",
        "microsoft_url": "https://support.microsoft.com/en-us/office/log10-function-c75b881b-49dd-44fb-b6f4-37e3486a0211"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "LOG10"
        },
        {
          "locale": "bg-BG",
          "name": "LOG10"
        },
        {
          "locale": "cs-CZ",
          "name": "LOG10"
        },
        {
          "locale": "da-DK",
          "name": "LOG10"
        },
        {
          "locale": "de-DE",
          "name": "LOG10"
        },
        {
          "locale": "el-GR",
          "name": "LOG10"
        },
        {
          "locale": "en-AU",
          "name": "LOG10"
        },
        {
          "locale": "en-GB",
          "name": "LOG10"
        },
        {
          "locale": "en-US",
          "name": "LOG10"
        },
        {
          "locale": "es-ES",
          "name": "LOG10"
        },
        {
          "locale": "et-EE",
          "name": "LOG10"
        },
        {
          "locale": "fi-FI",
          "name": "LOG10"
        },
        {
          "locale": "fr-FR",
          "name": "LOG10"
        },
        {
          "locale": "he-IL",
          "name": "LOG10"
        },
        {
          "locale": "hr-HR",
          "name": "LOG10"
        },
        {
          "locale": "hu-HU",
          "name": "LOG10"
        },
        {
          "locale": "id-ID",
          "name": "LOG10"
        },
        {
          "locale": "it-IT",
          "name": "LOG10"
        },
        {
          "locale": "ja-JP",
          "name": "LOG10"
        },
        {
          "locale": "ko-KR",
          "name": "LOG10"
        },
        {
          "locale": "lt-LT",
          "name": "LOG10"
        },
        {
          "locale": "lv-LV",
          "name": "LOG10"
        },
        {
          "locale": "nb-NO",
          "name": "LOG10"
        },
        {
          "locale": "nl-NL",
          "name": "LOG10"
        },
        {
          "locale": "pl-PL",
          "name": "LOG10"
        },
        {
          "locale": "pt-BR",
          "name": "LOG10"
        },
        {
          "locale": "pt-PT",
          "name": "LOG10"
        },
        {
          "locale": "ro-RO",
          "name": "LOG10"
        },
        {
          "locale": "ru-RU",
          "name": "LOG10"
        },
        {
          "locale": "sk-SK",
          "name": "LOG10"
        },
        {
          "locale": "sl-SI",
          "name": "LOG10"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "LOG10"
        },
        {
          "locale": "sv-SE",
          "name": "LOG10"
        },
        {
          "locale": "th-TH",
          "name": "LOG10"
        },
        {
          "locale": "tr-TR",
          "name": "LOG10"
        },
        {
          "locale": "uk-UA",
          "name": "LOG10"
        },
        {
          "locale": "vi-VN",
          "name": "LOG10"
        },
        {
          "locale": "zh-CN",
          "name": "LOG10"
        },
        {
          "locale": "zh-HK",
          "name": "LOG10"
        },
        {
          "locale": "zh-TW",
          "name": "LOG10"
        }
      ],
      "signature": {
        "display": "LOG10(number)",
        "parameters": [
          {
            "description": null,
            "name": "number",
            "optional": false,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "LOG10",
      "version_marker": null,
      "xlcall": {
        "code": "23",
        "symbol": "xlfLog10"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/log10-function-c75b881b-49dd-44fb-b6f4-37e3486a0211"
  },
  "try_it": {
    "formula": "=LOG10(100)"
  },
  "url": "https://handbook.dnacalc.com/functions/LOG10.html",
  "variants": [],
  "versions": [
    {
      "behaviour": "43 captured inputs are indexed for this environment. Capture dates are not recorded. This is a reading count, not a comparison with another build.",
      "excel_build": "16.0 build 19929",
      "platform": "Windows, bitness not recorded, CPU not recorded",
      "sources": [
        "https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.LOG10.json"
      ]
    },
    {
      "behaviour": "2,823 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.LOG10.json"
      ]
    }
  ]
}