title: Variables craziness, rounding number (int,double etc.)
body: <p>This is mine code, not fully finished, and sorry for Polish language but it's easy to get it.
  <a href="http://pastebin.com/QPmVaPFv" rel="nofollow">http://pastebin.com/QPmVaPFv</a>
  So, this is about vet, 4 variables are for price per visitor:
  1. Big dog
  2. Medium dog
  3. Small dog
  4.cat
  After that next 4 variables are for numbers of visitor, same as before (big,medium,small,cat etc.)</p>
  
  <p>Then text says: 
  every 5th big dog owner got 10% discount
  every 3rd medium owner got 50% discount
  every 4th cat owner got price at 1$ i.e</p>
  
  <pre><code>double zdpies=ldpies/5.;
  double zspies=lspies/3.;
  double zkot=ckot/4.;
  </code></pre>
  
  <p>This is that part with discounts</p>
  
  <p>after that i made variables with calculations on discounted price</p>
  
  <pre><code>double cdpiespromo=cdpies/10.; Big dog
  double cspiespromo=cspies/50.; medium dog
  double ckotpromo=1; Cat
  </code></pre>
  
  <p>Then i made calculation for final price i.e for normal price without discount</p>
  
  <p>--- cena normalna: 21.6 x 51.0 = 1101.6000000000001</p>
  
  <p>Process completed.</p>
  
  <p>And i got that strange numbers, 51. is ok but 21.6 is wrong that must be 22 not 21.6. When i use "int" it says there is "loss of precision", any ideas how to fix that ?  </p>
  
  <p>Here are last variables for calculating final price discounted and without discount.</p>
  
  <pre><code>double idp=ldpies-zdpies; this calculates numbers of visitors without discount
  double idc=idp*cdpies; this calculates price number of visitor * normalpriceofbigdog.
  </code></pre>