diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml
new file mode 100644
index 0000000..f23f429
--- /dev/null
+++ b/.github/workflows/pages.yml
@@ -0,0 +1,90 @@
+name: Deploy GitHub Pages
+
+# Builds the docs/ site, substitutes the latest release tag into the HTML,
+# then deploys the result to GitHub Pages. Runs on:
+# - any push to main that touches docs/, this workflow, or CMakeLists.txt
+# - every published release (so a new tag refreshes the site)
+# - manual dispatch from the Actions tab
+on:
+ push:
+ branches: [main]
+ paths:
+ - "docs/**"
+ - ".github/workflows/pages.yml"
+ - "CMakeLists.txt"
+ release:
+ types: [published]
+ workflow_dispatch:
+
+# Required permissions for the deploy-pages action.
+permissions:
+ contents: read
+ pages: write
+ id-token: write
+
+# Avoid concurrent deploys; let the latest one win.
+concurrency:
+ group: "pages"
+ cancel-in-progress: false
+
+jobs:
+ build:
+ name: Build site
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6.0.2
+ with:
+ # Needed so the git-tag fallback can find release tags.
+ fetch-depth: 0
+ fetch-tags: true
+
+ - name: Resolve latest release version
+ id: version
+ env:
+ GH_TOKEN: ${{ github.token }}
+ run: |
+ set -euo pipefail
+ # Prefer the latest published GitHub release.
+ tag="$(gh release view --repo ${{ github.repository }} --json tagName --jq .tagName 2>/dev/null || true)"
+ if [ -z "${tag:-}" ]; then
+ # Fall back to the newest semver-looking git tag.
+ tag="$(git tag --sort=-v:refname | grep -E '^v?[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1 || true)"
+ fi
+ if [ -z "${tag:-}" ]; then
+ # Last-resort fallback: read version from CMakeLists.txt.
+ tag="v$(grep -E 'project\(fast_float VERSION' CMakeLists.txt | sed -E 's/.*VERSION ([0-9.]+).*/\1/')"
+ fi
+ # Strip a leading "v" — the template uses bare semver after "v".
+ version="${tag#v}"
+ echo "tag=${tag}" >> "$GITHUB_OUTPUT"
+ echo "version=${version}" >> "$GITHUB_OUTPUT"
+ echo "Resolved version: ${version} (tag ${tag})"
+
+ - name: Substitute version into HTML
+ run: |
+ set -euo pipefail
+ version='${{ steps.version.outputs.version }}'
+ # In-place replace every {{VERSION}} occurrence under docs/.
+ find docs -type f \( -name '*.html' -o -name '*.md' -o -name '*.css' -o -name '*.js' \) \
+ -exec sed -i "s/{{VERSION}}/${version}/g" {} +
+
+ - name: Setup Pages
+ uses: actions/configure-pages@v5
+
+ - name: Upload artifact
+ uses: actions/upload-pages-artifact@v3
+ with:
+ path: docs
+
+ deploy:
+ name: Deploy to GitHub Pages
+ needs: build
+ runs-on: ubuntu-latest
+ environment:
+ name: github-pages
+ url: ${{ steps.deployment.outputs.page_url }}
+ steps:
+ - name: Deploy
+ id: deployment
+ uses: actions/deploy-pages@v4
diff --git a/docs/.nojekyll b/docs/.nojekyll
new file mode 100644
index 0000000..e69de29
diff --git a/docs/README.md b/docs/README.md
new file mode 100644
index 0000000..640a9cb
--- /dev/null
+++ b/docs/README.md
@@ -0,0 +1,25 @@
+# fast_float website
+
+The source for .
+
+Static HTML, CSS, and a small JS file — no build step required. To preview
+locally, serve this directory with any static file server, for example:
+
+```bash
+python3 -m http.server -d docs 8080
+# then open http://localhost:8080/
+```
+
+## How the version number stays current
+
+The displayed release version is kept fresh by two independent mechanisms:
+
+1. **Build-time substitution.** The `Deploy GitHub Pages` workflow
+ (`.github/workflows/pages.yml`) replaces every occurrence of the literal
+ `{{VERSION}}` in `index.html` with the latest GitHub release tag before
+ publishing. The workflow runs on every push to `main` that touches
+ `docs/**`, on every published release, and can be dispatched manually.
+
+2. **Client-side refresh.** `assets/app.js` queries the GitHub Releases API
+ on page load and overwrites any element marked with `data-version`. This
+ means visitors see the very latest tag even between deploys.
diff --git a/docs/assets/app.js b/docs/assets/app.js
new file mode 100644
index 0000000..241a7a8
--- /dev/null
+++ b/docs/assets/app.js
@@ -0,0 +1,116 @@
+(function () {
+ "use strict";
+
+ // ---------- Theme toggle ----------
+ const root = document.documentElement;
+ const storedTheme = localStorage.getItem("ff-theme");
+ if (storedTheme === "light" || storedTheme === "dark") {
+ root.setAttribute("data-theme", storedTheme);
+ }
+ const toggle = document.getElementById("theme-toggle");
+ if (toggle) {
+ toggle.addEventListener("click", function () {
+ const current =
+ root.getAttribute("data-theme") ||
+ (window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light");
+ const next = current === "dark" ? "light" : "dark";
+ root.setAttribute("data-theme", next);
+ localStorage.setItem("ff-theme", next);
+ });
+ }
+
+ // ---------- Copy-to-clipboard on code blocks ----------
+ document.querySelectorAll("pre > code").forEach(function (code) {
+ const pre = code.parentElement;
+ if (!pre || pre.querySelector(".copy-btn")) return;
+ const btn = document.createElement("button");
+ btn.className = "copy-btn";
+ btn.type = "button";
+ btn.textContent = "Copy";
+ btn.setAttribute("aria-label", "Copy code to clipboard");
+ btn.addEventListener("click", function () {
+ const text = code.innerText;
+ const done = function () {
+ btn.textContent = "Copied";
+ btn.classList.add("copied");
+ setTimeout(function () {
+ btn.textContent = "Copy";
+ btn.classList.remove("copied");
+ }, 1400);
+ };
+ if (navigator.clipboard && navigator.clipboard.writeText) {
+ navigator.clipboard.writeText(text).then(done, function () {
+ fallbackCopy(text);
+ done();
+ });
+ } else {
+ fallbackCopy(text);
+ done();
+ }
+ });
+ pre.appendChild(btn);
+ });
+
+ function fallbackCopy(text) {
+ const ta = document.createElement("textarea");
+ ta.value = text;
+ ta.style.position = "fixed";
+ ta.style.opacity = "0";
+ document.body.appendChild(ta);
+ ta.select();
+ try { document.execCommand("copy"); } catch (e) { /* ignore */ }
+ document.body.removeChild(ta);
+ }
+
+ // ---------- Live version refresh from GitHub Releases ----------
+ // The build-time workflow substitutes {{VERSION}} in the HTML; this
+ // additionally refreshes the displayed version in the browser so the
+ // site always reflects the very latest release without redeploying.
+ const versionNodes = document.querySelectorAll("[data-version]");
+ const downloadLink = document.getElementById("download-latest");
+ if (versionNodes.length === 0) return;
+
+ // Don't refetch more than once per hour per visitor.
+ const CACHE_KEY = "ff-latest-release";
+ const CACHE_TTL = 60 * 60 * 1000;
+ let cached = null;
+ try {
+ const raw = localStorage.getItem(CACHE_KEY);
+ if (raw) {
+ const parsed = JSON.parse(raw);
+ if (parsed && parsed.ts && Date.now() - parsed.ts < CACHE_TTL) {
+ cached = parsed;
+ }
+ }
+ } catch (e) { /* ignore */ }
+
+ if (cached && cached.tag) {
+ applyVersion(cached.tag, cached.url);
+ } else {
+ fetch("https://api.github.com/repos/fastfloat/fast_float/releases/latest", {
+ headers: { Accept: "application/vnd.github+json" },
+ })
+ .then(function (r) { return r.ok ? r.json() : null; })
+ .then(function (data) {
+ if (!data || !data.tag_name) return;
+ try {
+ localStorage.setItem(
+ CACHE_KEY,
+ JSON.stringify({ ts: Date.now(), tag: data.tag_name, url: data.html_url })
+ );
+ } catch (e) { /* ignore */ }
+ applyVersion(data.tag_name, data.html_url);
+ })
+ .catch(function () { /* offline / rate limited — keep build-time value */ });
+ }
+
+ function applyVersion(tag, url) {
+ const clean = tag.replace(/^v/, "");
+ versionNodes.forEach(function (el) {
+ // Preserve a leading "v" if the original text used one.
+ const wasV = (el.textContent || "").trim().startsWith("v");
+ el.textContent = (wasV ? "v" : "") + clean;
+ });
+ if (downloadLink && url) downloadLink.href = url;
+ }
+})();
diff --git a/docs/assets/logo.svg b/docs/assets/logo.svg
new file mode 100644
index 0000000..35043fc
--- /dev/null
+++ b/docs/assets/logo.svg
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/assets/style.css b/docs/assets/style.css
new file mode 100644
index 0000000..c57c40b
--- /dev/null
+++ b/docs/assets/style.css
@@ -0,0 +1,454 @@
+:root {
+ --bg: #ffffff;
+ --bg-alt: #f7f8fb;
+ --surface: #ffffff;
+ --text: #0f172a;
+ --text-muted: #475569;
+ --border: #e2e8f0;
+ --accent: #2563eb;
+ --accent-strong: #1d4ed8;
+ --accent-soft: rgba(37, 99, 235, 0.10);
+ --grad-from: #2563eb;
+ --grad-to: #0ea5e9;
+ --code-bg: #0f172a;
+ --code-text: #e2e8f0;
+ --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
+ --radius: 12px;
+ --radius-sm: 8px;
+ --maxw: 1100px;
+}
+
+:root[data-theme="dark"] {
+ --bg: #0b1020;
+ --bg-alt: #0f172a;
+ --surface: #121a2e;
+ --text: #e6edf7;
+ --text-muted: #94a3b8;
+ --border: #1f2a44;
+ --accent: #60a5fa;
+ --accent-strong: #93c5fd;
+ --accent-soft: rgba(96, 165, 250, 0.14);
+ --grad-from: #60a5fa;
+ --grad-to: #22d3ee;
+ --code-bg: #060a17;
+ --code-text: #e6edf7;
+ --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
+}
+
+@media (prefers-color-scheme: dark) {
+ :root:not([data-theme="light"]) {
+ --bg: #0b1020;
+ --bg-alt: #0f172a;
+ --surface: #121a2e;
+ --text: #e6edf7;
+ --text-muted: #94a3b8;
+ --border: #1f2a44;
+ --accent: #60a5fa;
+ --accent-strong: #93c5fd;
+ --accent-soft: rgba(96, 165, 250, 0.14);
+ --grad-from: #60a5fa;
+ --grad-to: #22d3ee;
+ --code-bg: #060a17;
+ --code-text: #e6edf7;
+ --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
+ }
+}
+
+* { box-sizing: border-box; }
+
+html { scroll-behavior: smooth; }
+
+body {
+ margin: 0;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
+ font-size: 16px;
+ line-height: 1.6;
+ color: var(--text);
+ background: var(--bg);
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+a { color: var(--accent); text-decoration: none; }
+a:hover { text-decoration: underline; }
+
+code, pre {
+ font-family: "SF Mono", Menlo, Consolas, "Liberation Mono", "Roboto Mono", monospace;
+ font-size: 0.92em;
+}
+:not(pre) > code {
+ background: var(--accent-soft);
+ color: var(--accent-strong);
+ padding: 0.12em 0.4em;
+ border-radius: 4px;
+ font-size: 0.88em;
+}
+
+pre {
+ background: var(--code-bg);
+ color: var(--code-text);
+ padding: 1.1rem 1.2rem;
+ border-radius: var(--radius);
+ overflow-x: auto;
+ margin: 1rem 0 1.5rem;
+ position: relative;
+ box-shadow: var(--shadow);
+ font-size: 0.88rem;
+ line-height: 1.55;
+}
+pre code { background: transparent; color: inherit; padding: 0; }
+/* highlight.js applies its own background — keep our pre styling */
+pre code.hljs { background: transparent; padding: 0; }
+
+.copy-btn {
+ position: absolute;
+ top: 8px;
+ right: 8px;
+ background: rgba(255, 255, 255, 0.08);
+ color: var(--code-text);
+ border: 1px solid rgba(255, 255, 255, 0.12);
+ border-radius: 6px;
+ padding: 4px 10px;
+ font-size: 0.75rem;
+ cursor: pointer;
+ opacity: 0;
+ transition: opacity 0.15s ease, background 0.15s ease;
+}
+pre:hover .copy-btn { opacity: 1; }
+.copy-btn:hover { background: rgba(255, 255, 255, 0.15); }
+.copy-btn.copied { background: rgba(34, 197, 94, 0.25); border-color: rgba(34, 197, 94, 0.5); }
+
+.container {
+ max-width: var(--maxw);
+ margin: 0 auto;
+ padding: 0 1.25rem;
+}
+
+.skip {
+ position: absolute; left: -9999px;
+ background: var(--accent); color: white;
+ padding: 0.6rem 1rem; border-radius: 0 0 6px 0;
+}
+.skip:focus { left: 0; top: 0; }
+
+/* Header */
+.site-header {
+ position: sticky;
+ top: 0;
+ z-index: 50;
+ backdrop-filter: saturate(180%) blur(12px);
+ -webkit-backdrop-filter: saturate(180%) blur(12px);
+ background: color-mix(in srgb, var(--bg) 80%, transparent);
+ border-bottom: 1px solid var(--border);
+}
+.nav {
+ display: flex;
+ align-items: center;
+ gap: 1.25rem;
+ height: 60px;
+}
+.brand {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.55rem;
+ font-weight: 700;
+ color: var(--text);
+ text-decoration: none;
+}
+.brand img { display: block; }
+.primary-nav {
+ display: flex;
+ gap: 1.2rem;
+ margin-left: 1rem;
+ flex: 1;
+}
+.primary-nav a {
+ color: var(--text-muted);
+ font-size: 0.92rem;
+ font-weight: 500;
+}
+.primary-nav a:hover { color: var(--text); text-decoration: none; }
+.nav-actions { display: flex; align-items: center; gap: 0.5rem; }
+
+.ghost-btn {
+ display: inline-flex; align-items: center; gap: 0.4rem;
+ padding: 0.45rem 0.8rem;
+ border: 1px solid var(--border);
+ border-radius: 8px;
+ color: var(--text);
+ font-size: 0.9rem;
+ background: var(--surface);
+ transition: border-color 0.15s, background 0.15s;
+}
+.ghost-btn:hover { border-color: var(--accent); text-decoration: none; }
+
+.theme-toggle {
+ width: 36px; height: 36px;
+ display: inline-flex; align-items: center; justify-content: center;
+ border: 1px solid var(--border);
+ border-radius: 8px;
+ background: var(--surface);
+ color: var(--text);
+ cursor: pointer;
+}
+.theme-toggle .i-moon { display: none; }
+.theme-toggle .i-sun { display: block; }
+:root[data-theme="dark"] .theme-toggle .i-sun,
+@media (prefers-color-scheme: dark) {
+ :root:not([data-theme="light"]) .theme-toggle .i-sun { display: none; }
+ :root:not([data-theme="light"]) .theme-toggle .i-moon { display: block; }
+}
+:root[data-theme="dark"] .theme-toggle .i-sun { display: none; }
+:root[data-theme="dark"] .theme-toggle .i-moon { display: block; }
+:root[data-theme="light"] .theme-toggle .i-sun { display: block; }
+:root[data-theme="light"] .theme-toggle .i-moon { display: none; }
+
+/* Hero */
+.hero {
+ padding: 5rem 0 4rem;
+ background:
+ radial-gradient(1200px 480px at 50% -10%, var(--accent-soft), transparent 70%),
+ var(--bg);
+ border-bottom: 1px solid var(--border);
+}
+.eyebrow {
+ display: inline-block;
+ font-size: 0.78rem;
+ font-weight: 600;
+ letter-spacing: 0.04em;
+ text-transform: uppercase;
+ color: var(--accent);
+ background: var(--accent-soft);
+ padding: 0.3rem 0.7rem;
+ border-radius: 999px;
+ margin-bottom: 1.25rem;
+}
+.hero h1 {
+ font-size: clamp(2rem, 4.6vw, 3.6rem);
+ line-height: 1.1;
+ margin: 0 0 1.25rem;
+ font-weight: 800;
+ letter-spacing: -0.02em;
+}
+.grad {
+ background: linear-gradient(90deg, var(--grad-from), var(--grad-to));
+ -webkit-background-clip: text;
+ background-clip: text;
+ color: transparent;
+}
+.lede {
+ font-size: 1.15rem;
+ color: var(--text-muted);
+ max-width: 720px;
+ margin: 0 0 2rem;
+}
+.lede strong { color: var(--text); }
+
+.cta-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-bottom: 1.75rem; }
+
+.btn {
+ display: inline-flex; align-items: center; gap: 0.5rem;
+ padding: 0.7rem 1.1rem;
+ border-radius: 10px;
+ font-weight: 600;
+ font-size: 0.95rem;
+ border: 1px solid var(--border);
+ background: var(--surface);
+ color: var(--text);
+ cursor: pointer;
+ transition: transform 0.05s ease, border-color 0.15s, background 0.15s;
+}
+.btn:hover { text-decoration: none; border-color: var(--accent); }
+.btn:active { transform: translateY(1px); }
+.btn.primary {
+ background: var(--accent);
+ border-color: var(--accent);
+ color: white;
+ box-shadow: 0 6px 20px rgba(37, 99, 235, 0.25);
+}
+.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
+.btn.ghost { background: transparent; }
+.btn code { background: rgba(255, 255, 255, 0.18); color: inherit; padding: 0.1em 0.45em; border-radius: 4px; }
+.btn:not(.primary) code { background: var(--accent-soft); color: var(--accent-strong); }
+
+.hero-meta {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0.6rem 1rem;
+ align-items: center;
+ font-size: 0.9rem;
+ color: var(--text-muted);
+}
+.badge {
+ display: inline-flex; align-items: center; gap: 0.5rem;
+ padding: 0.3rem 0.7rem;
+ border: 1px solid var(--border);
+ border-radius: 999px;
+ background: var(--surface);
+}
+.badge code { background: transparent; color: var(--text); padding: 0; }
+.badge .dot {
+ width: 8px; height: 8px; border-radius: 50%;
+ background: #22c55e;
+ box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
+}
+.meta-link { color: var(--text-muted); }
+.meta-link:hover { color: var(--accent); }
+
+/* Sections */
+.section { padding: 4.5rem 0; }
+.section.alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
+.section h2 {
+ font-size: clamp(1.6rem, 3vw, 2.2rem);
+ margin: 0 0 0.5rem;
+ letter-spacing: -0.01em;
+}
+.section h3 { margin: 1.75rem 0 0.6rem; font-size: 1.1rem; }
+.section-lede { color: var(--text-muted); max-width: 720px; margin: 0 0 2rem; }
+
+/* Grid cards */
+.grid { display: grid; gap: 1rem; }
+.grid.features { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
+.grid.install { grid-template-columns: 1fr; }
+
+.card {
+ background: var(--surface);
+ border: 1px solid var(--border);
+ border-radius: var(--radius);
+ padding: 1.4rem 1.4rem 1.5rem;
+ box-shadow: var(--shadow);
+ transition: transform 0.12s ease, border-color 0.15s;
+}
+.card:hover { transform: translateY(-2px); border-color: var(--accent); }
+.card h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
+.card p, .card ul { margin: 0; color: var(--text-muted); font-size: 0.95rem; }
+.card pre { margin: 0.6rem 0 0; font-size: 0.82rem; }
+
+.bullets { padding-left: 1.1rem; }
+.bullets li { margin: 0.2rem 0; }
+
+/* Benchmarks */
+.bench {
+ background: var(--surface);
+ border: 1px solid var(--border);
+ border-radius: var(--radius);
+ padding: 1.5rem;
+ box-shadow: var(--shadow);
+}
+.bench-row {
+ display: grid;
+ grid-template-columns: 160px 1fr;
+ align-items: center;
+ gap: 0.9rem;
+ margin: 0.55rem 0;
+}
+.bench-label { font-weight: 600; color: var(--text); font-size: 0.95rem; }
+.bench-bar {
+ background: var(--bg-alt);
+ border-radius: 6px;
+ overflow: hidden;
+ height: 28px;
+ position: relative;
+}
+.bench-fill {
+ display: inline-flex;
+ align-items: center;
+ height: 100%;
+ width: var(--w, 0%);
+ background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 35%, transparent), color-mix(in srgb, var(--accent) 55%, transparent));
+ color: var(--text);
+ padding: 0 0.7rem;
+ border-radius: 6px;
+ font-variant-numeric: tabular-nums;
+ font-size: 0.85rem;
+ font-weight: 600;
+ white-space: nowrap;
+}
+.bench-fill.primary {
+ background: linear-gradient(90deg, var(--grad-from), var(--grad-to));
+ color: white;
+}
+
+@media (max-width: 600px) {
+ .bench-row { grid-template-columns: 1fr; gap: 0.3rem; }
+}
+
+.repro {
+ margin-top: 1.25rem;
+ border: 1px solid var(--border);
+ border-radius: var(--radius-sm);
+ background: var(--surface);
+ padding: 0.4rem 1rem;
+}
+.repro summary {
+ cursor: pointer;
+ padding: 0.5rem 0;
+ font-weight: 600;
+ color: var(--text-muted);
+}
+.repro[open] summary { color: var(--text); }
+.repro pre { margin: 0.5rem 0 0.75rem; }
+
+/* Users list */
+.users {
+ list-style: none;
+ padding: 0;
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
+ gap: 0.6rem 1rem;
+}
+.users li {
+ padding: 0.7rem 0.9rem;
+ border: 1px solid var(--border);
+ border-radius: var(--radius-sm);
+ background: var(--surface);
+ font-size: 0.92rem;
+ color: var(--text-muted);
+}
+.users li strong { color: var(--text); margin-right: 0.35rem; }
+.aside { color: var(--text-muted); margin-top: 1.5rem; font-size: 0.92rem; }
+
+.papers { list-style: none; padding: 0; }
+.papers li {
+ padding: 1rem 1.2rem;
+ border: 1px solid var(--border);
+ border-radius: var(--radius-sm);
+ background: var(--surface);
+ margin-bottom: 0.7rem;
+}
+
+/* Footer */
+.site-footer {
+ background: var(--bg-alt);
+ border-top: 1px solid var(--border);
+ padding: 3rem 0 2rem;
+ color: var(--text-muted);
+ font-size: 0.92rem;
+ margin-top: 2rem;
+}
+.footer-grid {
+ display: grid;
+ grid-template-columns: 1.5fr 1fr 1fr;
+ gap: 2rem;
+ margin-bottom: 2rem;
+}
+.site-footer h4 { color: var(--text); font-size: 0.95rem; margin: 0 0 0.6rem; }
+.site-footer ul { list-style: none; padding: 0; margin: 0; }
+.site-footer li { margin: 0.25rem 0; }
+.subfoot {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding-top: 1.5rem;
+ border-top: 1px solid var(--border);
+ flex-wrap: wrap;
+ gap: 0.5rem;
+}
+.subfoot code { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
+
+@media (max-width: 720px) {
+ .primary-nav { display: none; }
+ .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
+ .hero { padding: 3rem 0 2.5rem; }
+ .section { padding: 3rem 0; }
+}
diff --git a/docs/index.html b/docs/index.html
new file mode 100644
index 0000000..fd2d17d
--- /dev/null
+++ b/docs/index.html
@@ -0,0 +1,349 @@
+
+
+
+
+
+ fast_float — parse floating-point numbers at a gigabyte per second
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Skip to content
+
+
+
+
+
+
+
C++11 · header-only · triple-licensed
+
Parse floating-point numbers at a gigabyte per second .
+
+ fast_float is a header-only C++ implementation of
+ std::from_chars for float, double, and integer types.
+ Exact IEEE rounding, no allocations, no exceptions — often many times faster
+ than your standard library.
+
+
+
+
+
+
+
+
+
Why fast_float?
+
A drop-in from_chars built for performance-critical code paths.
+
+
+ Blazing fast
+ Often 4× faster than the best competitor and many times faster than typical standard-library implementations. Sustains 1 GB/s on commodity hardware.
+
+
+ Exact rounding
+ Returns the closest IEEE 754 float or double with round-to-nearest, ties-to-even — bit-for-bit correct.
+
+
+ Header-only
+ Just drop in fast_float.h or use it via CMake, Conan, vcpkg, xmake, or Homebrew. Requires only C++11.
+
+
+ No surprises
+ Does not allocate, does not throw, locale-independent. The interface mirrors C++17 std::from_chars.
+
+
+ Integers too
+ Parses every standard integer type in bases 2–36, plus bool. The same fast, allocation-free interface.
+
+
+ Unicode & formats
+ UTF-8, UTF-16, and UTF-32 inputs. JSON, Fortran, and custom decimal separators via from_chars_advanced.
+
+
+ constexpr-ready
+ In C++20, parse strings at compile time with consteval — zero runtime cost.
+
+
+ Portable
+ Visual Studio, GCC, Clang, MSYS2. Linux, macOS, FreeBSD, Windows. x86-64, ARM, RISC-V, s390x. 32-bit and 64-bit.
+
+
+
+
+
+
+
+
+
+
Quick start
+
Parse a double from a string in three lines.
+
+
#include "fast_float/fast_float.h"
+#include <iostream>
+#include <string>
+
+int main() {
+ std::string input = "3.1416 xyz ";
+ double result;
+ auto answer = fast_float::from_chars(input.data(),
+ input.data() + input.size(),
+ result);
+ if (answer.ec != std::errc()) {
+ std::cerr << "parsing failure\n";
+ return EXIT_FAILURE;
+ }
+ std::cout << "parsed the number " << result << '\n';
+}
+
+
Integers in any base (2–36)
+
uint64_t value;
+std::string hex = "4f0cedc95a718c";
+auto r = fast_float::from_chars(hex.data(), hex.data() + hex.size(), value, 16);
+// value == 22250738585072012
+
+
UTF-16 input
+
std::u16string input = u"3.1416 xyz ";
+double result;
+auto r = fast_float::from_chars(input.data(), input.data() + input.size(), result);
+
+
Comma as decimal separator, Fortran, or JSON
+
// "3,1416" — French-style
+fast_float::parse_options opts{fast_float::chars_format::general, ','};
+fast_float::from_chars_advanced(s.data(), s.data() + s.size(), result, opts);
+
+// "1d+4" — Fortran exponent
+opts = {fast_float::chars_format::fortran};
+
+// strict JSON per RFC 8259
+opts = {fast_float::chars_format::json};
+
+
C++20: parse at compile time
+
consteval double parse(std::string_view s) {
+ double v;
+ auto r = fast_float::from_chars(s.data(), s.data() + s.size(), v);
+ return r.ec == std::errc() ? v : -1.0;
+}
+constexpr double pi = parse("3.1415"); // computed at compile time
+
+
+
+
+
+
Install
+
Pick the workflow that matches your project.
+
+
+
+ CMake FetchContent
+FetchContent_Declare(
+ fast_float
+ GIT_REPOSITORY https://github.com/fastfloat/fast_float.git
+ GIT_TAG tags/v{{VERSION}}
+ GIT_SHALLOW TRUE)
+FetchContent_MakeAvailable(fast_float)
+target_link_libraries(myprogram PUBLIC fast_float)
+
+
+
+ CPM
+CPMAddPackage(
+ NAME fast_float
+ GITHUB_REPOSITORY "fastfloat/fast_float"
+ GIT_TAG v{{VERSION}})
+
+
+
+ Single header
+ Download a pre-amalgamated header — no build system required.
+curl -LO https://github.com/fastfloat/fast_float/releases/download/v{{VERSION}}/fast_float.h
+
+
+
+ Package managers
+
+
+
+
+
+
+
+
+
Trusted by
+
fast_float ships inside compilers, browsers, databases, and more.
+
+ GCC — backs std::from_chars since version 12
+ Chromium — Chrome, Edge, and Opera
+ WebKit — Safari
+ Ladybird — independent browser engine
+ DuckDB — in-process analytical database
+ Apache Arrow — 2–3× faster number parsing
+ ClickHouse — OLAP database
+ MySQL
+ Boost.JSON
+ Blender
+ Google Jsonnet
+
+
+ Ports and bindings exist for
+ Rust ,
+ Java ,
+ C# ,
+ C , and
+ R .
+
+
+
+
+
+
+
The research behind it
+
+
+
+
+
+
+
+
+
+
+
+
+
+