{
  "id": 583270,
  "title": "The fastest double-to-string algorithm you’ve never heard of",
  "url": "https://urgent.news/2026/08/11/the-fastest-double-to-string-algorithm-youve-never-heard-of",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-11T16:42:55.000Z",
  "source": {
    "name": "Lobsters",
    "slug": "lobsters",
    "url": "https://vitaut.net/posts/2026/yy-dtoa/"
  },
  "original_language": "en",
  "account": "The yy algorithm, used in the binary-to-decimal conversion library Żmij, is a fast dtoa implementation not widely known. It operates on fixed-width integer arithmetic and uses only one multiplication by a precomputed power of 10, unlike classic Schubfach which requires two or three. For each binary float v = c · 2^e2, yy determines a decimal exponent e10 using a fixed-point approximation of log10 2. The binary float v is then re-expressed at the decimal scale using a precomputed power-of-10 table p10, such that p10 · 2^ep ≈ 10^(-e10). This results in a value called bar v, which lies between four candidate decimal values. The algorithm prefers the shorter decimal representation if it rounds-trips, otherwise it falls back to the longer one. The comparison involves three predicates evaluated against bar v and a half-ulp band δ around it. These predicates determine whether bar v reaches d0, u0, or requires a fallback to d1 or u1. The yy algorithm's key optimization is the one-multiplication claim, achieved by scaling the half-ulp of v by p10, which is a simple integer shift. This allows the algorithm to avoid an additional multiplication required by Schubfach. The algorithm also handles irregular intervals, subnormals, and the digit-emission loop for a complete implementation.",
  "summary": null,
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}