ELSEIF
Your brief EB
331 stories from 95 feeds 217 clusters Refreshed 6 minutes ago next pull 19:36

TECH Signal 390

The fastest double-to-string algorithm you’ve never heard of

Illustration only Photo by Mitchell Luo on Unsplash

An algorithm called yy from the yyjson library performs double-to-string conversion using only one multiplication by a precomputed power of 10, reducing the overhead compared to classic Schubfach implementations.

WHY IT MATTERS

Engineers working on high-throughput JSON parsing can replace existing dtoa routines with this fixed-width integer approach to cut multiplication costs. The trade-off is managing the specific boundary cases and subnormal paths the algorithm requires to maintain correct round-trip behavior.

Written by elseif from the cluster below · every claim links back to a source

The three things worth knowing

01

The yy algorithm finds the shortest decimal string that round-trips back to a binary float using fixed-width integer arithmetic.

02

It reduces multiplication overhead by deriving the half-ulp rounding band delta via an integer shift of the precomputed power-of-10 table value rather than a separate multiplication.

03

The algorithm selects from four decimal candidates using three predicates that implement round-half-to-even logic at exact ties.

THE CLUSTER

Same story, 1 feed.

ORDERED BY FIRST SEEN
Lobsters The fastest double-to-string algorithm you’ve never heard of Open ↗