What Every Programmer Should Know About Floating-Point Arithmetic


Why don’t my numbers add up?

So you’ve written some absurdly simple code, say for example:

	0.1 + 0.2

and got a really unexpected result:


Maybe you asked for help on some forum and got pointed to a long article with lots of formulas that didn’t seem to help with your problem.

Well, this site is here to:

You should look at the Basic Answers first - but don’t stop there!

© Published at floating-point-gui.de under the Creative Commons Attribution License (BY)

Fork me on GitHub