floating-point-gui.de
Website that provides concise answers to common questions about floating-point numbers.
An educational static website explaining why floating-point math gives surprising results like 0.1+0.2=0.30000000000000004, and how to handle it.
Floating Point GUI
If you've ever written code and gotten a surprising result like 0.1 + 0.2 = 0.30000000000000004 instead of 0.3, you've run into floating-point numbers — and you're definitely not alone. This website exists to answer the questions that come next: Why did that happen? Is my code broken? How do I fix it?
The site tackles floating-point numbers from two angles. If you just want a quick, straightforward answer to a common question, you'll find that. But if you want to understand what's actually happening under the hood — how computers store decimals in binary, why certain calculations are imprecise, and when floating-point numbers are the right choice — there's deeper material too. It bridges the gap between "my math is wrong" panic and actual understanding.
This is most useful for beginner and intermediate programmers who encounter floating-point quirks and want clarity without needing a computer science degree. It's also handy for anyone choosing between different number types in their code — like deciding whether to use floating-point, fixed-point, or decimal representations. The site doesn't just say "floating-point is weird"; it explains why, and what your options are.
The website itself is built using nanoc, a static site generator that compiles content into plain HTML files. This keeps it fast and simple to host. The content is published under a Creative Commons license, so it's free to use and share.
Where it fits
- Look up why a calculation like 0.1 + 0.2 doesn't equal exactly 0.3 in your code.
- Read the deeper material to understand how computers store decimals in binary.
- Decide whether floating-point, fixed-point, or decimal representation fits your use case.