May 8, 2026
When numbers start gaslighting
Floats Don't Agree with Themselves
One tiny math wobble split the internet into nerd cheers, style complaints, and compiler fights
TLDR: A developer found that tiny rounding quirks made the same shape-checking code disagree across machines, so they built a no-floats replacement. Commenters loved the math drama, but also fought over the writing style, demanded hard proof, and argued about whether the compiler was really to blame.
A programmer discovered the kind of bug that makes developers stare into the void: the same program, with the same input, gave different answers on different machines. The culprit was ordinary computer math using decimals, where microscopic rounding differences can snowball into a totally different result. Instead of patching around it, the author built exact-poly, a geometry tool that avoids float math entirely so the browser and server finally agree.
But the real fireworks were in the comments, where the crowd immediately split into camps. One group was pure nerd delight, cheering the mention of famous numerical computing legend Shewchuk like it was a surprise celebrity cameo. Another commenter sighed, "Makes you wish everyone agreed on extended precision!" which is basically the tech equivalent of begging divorced parents to get back together for the kids. Then came the style police: one reader said the dramatic opener "Same code. Same input. Different answer" felt so much like AI writing that it made them want to bail instantly. Ouch.
And because this is the internet, people also demanded receipts. One commenter wanted the exact three numbers that caused the mismatch, while another challenged whether Rust would even allow the compiler tricks blamed in the post. So yes, the article is about tiny math differences — but the comment section turned it into a full-on brawl about writing style, proof, and who gets to blame the compiler
Key Points
- •The article describes a polygon-overlap test that produced different results on different platforms because floating-point rounding differed near zero.
- •The critical computation was the sign of `(B - A) cross (C - A)`, which controls geometric decisions such as convex versus reflex vertices.
- •The article identifies several sources of floating-point divergence across systems, including x87 extended precision, fused multiply-add contraction, reassociation, and denormal flushing.
- •The author argues that IEEE 754 standardizes formats and basic operations but does not guarantee reproducible behavior across architectures, toolchains, and flags.
- •As a solution, the author built `exact-poly`, a 2D geometry library using integer arithmetic and says it runs in production on merca.earth using WASM and `i64` math.