dconv 2.0
C++14 library for printing and parsing floating point numbers
Loading...
Searching...
No Matches
AGENTS.md

dconv: header-only C++20 double ⇄ string library (dconv/include/dconv/), used by join. Tests in dconv/tests/, table generators in tools/.

Build and test

Presets gcc|clang x debug|release|asan (debug = coverage), trees in build/<compiler>/<kind>. -Werror is on.

cmake --preset gcc-debug && cmake --build --preset gcc-debug && ctest --preset gcc-debug

Architecture

  • dtoa: dconv::dtoa -> schubfach::dtoa. Each algorithm (schubfach, grisu, grisu2, grisu3) has generate (buffer, length, k, value); the Grisu family renders it through the grisu.hpp driver and details::prettify, while schubfach::dtoa calls shortest then details::format; grisu3 falls back to std::to_chars.
  • atod: all overloads go through details::atod<Probe>. StringProbe seeks back to re-parse > 19 digits; StreamProbe never rewinds, so they go to atodLong (Eisel-Lemire bracketing, strtod only on disagreement). Errc::NotDouble reports 64-bit integers.
  • Power tables (*pow.hpp): generated by tools/*powgen.

Agent files

Skills in .agents/skills/<name>/SKILL.md: compile, test, coverage, conformance, performance, add-gtest, gen-tables, create-pr, release; <scratchpad> in them is a temporary directory outside the repository. Run clang-format on changed C++ files at the version pinned in .github/workflows/build.yml.

Changes to AGENTS.md and .agents/ keep them tool-agnostic and short; .claude/ is Claude Code only.

Definition of done

  • Dev loop: gcc-debug, the relevant test only, once the batch is reviewed (not after each edit). Renames: diff and clang-format only. Design still moving: code and benchmarks only.
  • Closing (once, when the user says ready to merge), gcc and clang: scope limited to the request; tests added; debug, release, asan pass; coverage not degraded; if conversion code changed, conformance and performance not degraded; README.md updated if the API or behaviour changes, else say none needed.

Report what ran; never call a partial pass done. A missing tool or wrong version: ask before installing (sudo if justified), else give the command with the ! prefix, and report the item not verified.

Working agreements

  • English for code, comments, commits, PRs, docs and branches.
  • Brief answers. Change only what was requested; extras as separate proposals.
  • Plain code first, measured; tricks, fast paths or new helpers only as a measured, proposed option.
  • Show one diff at a time; edit only after an explicit yes covering that diff ("ok" after an either/or question is not a choice). Reading, building, measuring and scratchpad work need no approval.
  • Ask before any state-changing git command (except <scratchpad> worktrees for measurements) and each PR (skill create-pr); read-only ones are fine. Never force-push, push to main or merge.
  • Never edit build/ or generated version.hpp files.