{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nConsider a [[floating-point|RTKRSC3KPH]] system with base $\\beta$, precision $p$ and minimal exponent $e_{\\min}$.\nLet $x \\ne 0$ be a floating-point number written as $x = \\pm (d_0 . d_1 \\ldots d_{p-1})_\\beta \\times \\beta^{e}$, with $d_0 \\ne 0$ if $e \u003e e_{\\min}$.\nThe *unit in the last place* of $x$ is\n$$\\mathrm{ulp}(x) = \\beta^{\\,e - p + 1},$$\nthe value of the digit position $d_{p-1}$.\n\n## Remarks\n\nExample: with $\\beta = 10$ and $p = 3$, the number $x = 3.14 = 3.14 \\times 10^{0}$ has $e = 0$, so $\\mathrm{ulp}(x) = 10^{-2}$; its neighbours are $3.13$ and $3.15$.\nNon-example: in the same system, $0.001$ is not the ulp of $3.14$, since $3.141$ is not a floating-point number of precision $3$.\nThe ulp of $1$ is $\\beta^{1-p}$, the [[machine epsilon|JA3QXVF2B8]].\nSeveral variants of the definition exist; some define $\\mathrm{ulp}(x)$ for every real $x$ as the gap between the two floating-point numbers closest to $x$.\nThey agree away from powers of $\\beta$.\nRounding to nearest gives an error of at most $\\tfrac12 \\mathrm{ulp}$ of the result.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "HFBST11CT6",
    "kind": "definition",
    "msc": [
      "65G50",
      "65Y04"
    ],
    "name": "Unit in the last place",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Unit_in_the_last_place"
      }
    ],
    "tag": "NDS0H727BA",
    "uses": [
      "RTKRSC3KPH",
      "JA3QXVF2B8"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/NDS0H727BA/",
  "links": [
    {
      "field": "defines",
      "target": "HFBST11CT6"
    },
    {
      "field": "uses",
      "target": "RTKRSC3KPH"
    },
    {
      "field": "uses",
      "target": "JA3QXVF2B8"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/NDS0H727BA.md",
  "msc": [
    "65G50",
    "65Y04"
  ],
  "name": "Unit in the last place",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/NDS/NDS0H727BA.md",
  "status": null,
  "tag": "NDS0H727BA",
  "uri": "m2://NDS0H727BA",
  "url": "https://tamnd.github.io/math2/wiki/unit-in-the-last-place-definition/",
  "writing": {
    "tag": "NDS0H727BA",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      },
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
