title: Trailing decimal in result of adding double and integer values
body: <p>Using Visual Studio 2017, create a VB.net project, and run the following lines of code:</p>
  
  <pre><code>Dim a As Double = 0.52
  Dim value As Double
  value = a * 3              'value = 1.56
  value = value + 1          'value = 2.56
  value = value + 2          'value = 4.5600000000000005
  Console.WriteLine(value)   '4.56
  </code></pre>
  
  <p>If you put a break point before addition of 2 to value, you can see value holds 4.5600000000000005 instead of 4.56.</p>
  
  <p>Why does the value have the trailing 0.0000000000000005 after addition of 2 to it? And more importantly, how do I handle the trailing inaccuracies?</p>
  
  <p>That inaccuracy can be magnified if I perform multiplication and will surely screw up my end result.</p>