FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Shortest Round-Trip: Implementing IEEE 754 to Decimal Conversion in Go
NewsTools

Shortest Round-Trip: Implementing IEEE 754 to Decimal Conversion in Go

via Dev.toMark Lenhardt1mo ago

Every programmer has seen this: 0.1 + 0.2 = 0.30000000000000004 The joke is that floating-point arithmetic is broken. It isn't. IEEE 754 is doing exactly what it specifies. The problem surfaces when you need to serialize these values to text — and when two different systems need to produce exactly the same text for the same value. This is what RFC 8785 (JSON Canonicalization Scheme) requires: byte-deterministic JSON output. And the hardest part of that requirement is number formatting. You need the shortest decimal string that, when parsed back, recovers the original IEEE 754 bits. You need to agree on tie-breaking when two representations are equally short. And you need to match the exact output format specified by ECMA-262 Number serialization , because that's what RFC 8785 mandates. Go's strconv.FormatFloat is a high-quality shortest-round-trip formatter, but it is not an ECMA-262 conformance contract. So I implemented the Burger-Dybvig algorithm from scratch in 490 lines of Go, val

Continue reading on Dev.to

Opens in a new tab

Read Full Article
20 views

Related Articles

Galaxy Watch users in the US can finally track their blood pressure - here's what you need
News

Galaxy Watch users in the US can finally track their blood pressure - here's what you need

ZDNet • 20h ago

Your Mac Came With the Wrong Apps. These 7 Fix That
News

Your Mac Came With the Wrong Apps. These 7 Fix That

Medium Programming • 21h ago

Why You Start Projects but Never Finish Them
News

Why You Start Projects but Never Finish Them

Medium Programming • 21h ago

FedEx chooses partnerships over proprietary tech for its automation strategy
News

FedEx chooses partnerships over proprietary tech for its automation strategy

TechCrunch • 21h ago

News

Software You Can Love 2026 tickets are on sale

Lobsters • 21h ago

Discover More Articles