title: Incorrect float subtraction result
body: <p>DataSet</p>
  
  <pre><code>   id   qty CheckIn CheckOut
     5    10      1     0
     5    10      0     1
     5    1.6     1     0
     5    0.4     0     1
     5    0.4     0     1
     5    0.4     0     1
  </code></pre>
  
  <p>I am trying to select remaining quantity of <code>id</code> <code>5</code>.</p>
  
  <p><strong>Query:</strong></p>
  
  <pre><code>Select 
      (select SUM(qty) from tbl where id = 5 and CheckIn = 1) -
      (select SUM(qty) from tbl where id = 5 and CheckOut = 1)
  </code></pre>
  
  <p><strong>Expected Output:</strong> <code>4.0</code></p>
  
  <p><strong>Original Output:</strong> <code>3.9999999</code></p>
  
  <p>Even the individual queries return perfect values:</p>
  
  <pre><code>select SUM(qty) from tbl where id = 5 and CheckIn = 1  -- returns 11.6
  select SUM(qty) from tbl where id = 5 and CheckOut = 1 -- returns 11.2
  </code></pre>
  
  <p>But subtraction gives <code>3.9999999</code></p>
  
  <hr>
  
  <p>You can generate data using the below query:</p>
  
  <p>Here is the query to generate data set</p>
  
  <pre><code>CREATE TABLE [dbo].[tbl](
      [id] [int] NOT NULL,
      [qty] [float] NULL,
      [CheckIn] [bit] NULL,
      [CheckOut] [bit] NULL
  ) ON [PRIMARY]
  
  GO
  INSERT [dbo].[tbl] ([id], [qty], [CheckIn], [CheckOut]) VALUES (5, 10, 1, 0)
  GO
  INSERT [dbo].[tbl] ([id], [qty], [CheckIn], [CheckOut]) VALUES (5, 10, 0, 1)
  GO
  INSERT [dbo].[tbl] ([id], [qty], [CheckIn], [CheckOut]) VALUES (5, 1.6, 1, 0)
  GO
  INSERT [dbo].[tbl] ([id], [qty], [CheckIn], [CheckOut]) VALUES (5, 0.4, 0, 1)
  GO
  INSERT [dbo].[tbl] ([id], [qty], [CheckIn], [CheckOut]) VALUES (5, 0.4, 0, 1)
  GO
  INSERT [dbo].[tbl] ([id], [qty], [CheckIn], [CheckOut]) VALUES (5, 0.4, 0, 1)
  GO
  </code></pre>