why the output is yes no instead of no no #include
dpaste, pastebin, or github's gist makes the code OH so much easier to read... http://dpaste.com/1275611/ All numbers are stored in binary by the computer. That is why. Now to explain: Say that I have \(\frac{1}{3}\) and \(\frac{1}{6}\) and I say to save them to three decimal places. \(\frac{1}{3}\approx .333\) and \(\frac{1}{6}\approx .167\). Now, lets do some basic math! \(\frac{1}{3}=2\times \frac{1}{6}\) \(.333\ne 2\times .167\) This is a rounding error in ten base decimal math. What you are seeing in your program is a rounding error in base two (binary) floating point math.
Join our real-time social learning platform and learn together with your friends!