Tech article
Adding Floating-Point Decimals for Fun and Profit
No preview is available. Read the original article for the full story.
Hacker News | Sep 29, 2026 | ibobev
Automated excerpt
The floating-point number’s value is \(x = \pm 2^E(1 + F/{2^{52}})\). ulp, for “unit in the last place”, of \(x\). Second, it rounds this to the nearest floating-point number. We have \(\text{ulp}(x) = \text{ulp}(x+0. 01)\), so \(\text{float}(x + 0. 01) \equiv 0 \equiv \text{float}(x) \bmod \text{ulp}(x)\), so \[\text{error}(x + 0. 01) \equiv \text{error}(x) - 0. 01 \bmod \text{ulp}(x);\] that is, \(\text{error}(x)\) is an “arithmetic sequence with common difference −0. 01” modulo \(\text{ulp}(x)\).
Selected automatically from source text; not independently written or fact-checked. Read the original for full context.